|
|
Eduard Keilholz wrote: But why would you also disable all child controls, parent controls do disable child controls once disabled...
Yea I agree, disabling the parent is all that is required.
|
|
|
|
|
Am I inthe correct forum!
|
|
|
|
|
hi,
i have one transparent form (opacity=0.5).
now the problem is when there is windows media player running behind that form, either my form is hiding the playing content or the windows media player cannot show media.
|
|
|
|
|
Hi,
This is probably caused by the fact that the mediaplayer is using hardware acceleration to show the video (this is known as a video-overlay).
What that means, is that the mediaplayer is not actually showing the video but just a rectangle with a specific colour, and the videocard will then replace any pixel that has that colour with the video. I believe the video-overlay colour is usually rgb(16,0,16) but it could vary.
Make a form with its backcolor set to 16;0;16 and move it over your mediaplayer: you should see the video playing on your form then.
|
|
|
|
|
Hi Guys,
i am working on a project using vs2005,vb.net.
i have data on a datagrid as follows...
StockCode|Description|Qty,UOM
1234 |TEST |20 |KG
5678 |TEST2 |15 |KG
The Xml format required must be as follows...
<item>
<key>
<stockcode> 1234 </stockcode>
</key>
<description>TEST</description>
<qty>20</qty>
<uom>KG</uom>
</item>
i am currently reading the xml template and creating the xmldoc but it is taking way too long.
What is the fastest way to create this xml, bear in mind that my datagrid may have up to 30000 rows and 80 columns.
thanks
Anoop Brijmohun
|
|
|
|
|
If your grid is bound to a data base using a DataSet, I would like to inform you that you may use WriteXml function of DataSet object.
It will export all data in an Xml file in the desired format.
Such as -
Me.DataSet1.WriteXml("C:\DataSetXml.xml")
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
Hi,thanks
The DataGridView has been created by reading a csv file.
I have tried using DataSet.WriteXml and it does not give me the desired output format.
do you have any other ideas?
thanks for your help
Anoop Brijmohun
|
|
|
|
|
Hi
Is it possible to sub-class the fluent ribbon in Word2007 from a VB.NET addin app?
Sub-classing based on NativeWindow object does not seem to work.
Cheers
Rob
|
|
|
|
|
I have a few questions regarding the code below.
In the first highlighted section of the code below the employee names are added into the combo box using a large string array.
' Declare comboBox1 as a ComboBox.
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
' This method initializes the combo box, adding a large string
' array but limiting the drop-down size to six rows so the combo box
' doesn't cover other controls when it expands.
Private Sub InitializeComboBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Dim employees() As String = New String() {"Hamilton, David", _
"Hensien, Kari", "Hammond, Maria", "Harris, Keith", _
"Henshaw, Jeff D.", "Hanson, Mark", "Harnpadoungsataya, Sariya", _
"Harrington, Mark", "Harris, Keith", "Hartwig, Doris", _
"Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas", _
"Harnpadoungsataya, Sariya", "Henshaw, Jeff D.", "Henshaw, Jeff D.", _
"Hensien, Kari", "Harris, Keith", "Henshaw, Jeff D.", _
"Hensien, Kari", "Hasselberg, Jonas", "Harrington, Mark", _
"Hedlund, Magnus", "Hay, Jeff", "Heidepriem, Brandon D."}
ComboBox1.Items.AddRange(employees)
Me.ComboBox1.Location = New System.Drawing.Point(136, 32)
Me.ComboBox1.MaxDropDownItems = 5
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDown
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(136, 81)
Me.ComboBox1.TabIndex = 0
Me.Controls.Add(Me.ComboBox1)
End Sub
' This method is called when the user changes his or her selection.
' It searches for all occurrences of the selected employee's
' name in the Items array and adds the employee's name and
' the number of occurrences to TextBox1.Text.
' CAUTION This code exposes a known bug: If the index passed to the
' FindStringExact(searchString, index) method is the last index
' of the array, the code throws an exception.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim comboBox As comboBox = CType(sender, comboBox)
' Save the selected employee's name, because we will remove
' the employee's name from the list.
Dim selectedEmployee = CType(ComboBox1.SelectedItem, String)
Dim count As Integer = 0
Dim resultIndex As Integer = -1
' Call the FindStringExact method to find the first
' occurrence in the list.
resultIndex = ComboBox1.FindStringExact (ComboBox1.SelectedItem)
' Remove the name as it is found, and increment the found count.
' Then call the FindStringExact method again, passing in the index of the
' current found item so the search starts there instead of
' at the beginning of the list.
While (resultIndex <> -1)
ComboBox1.Items.RemoveAt(resultIndex)
count += 1
resultIndex = ComboBox1.FindStringExact _
(selectedEmployee, resultIndex)
End While
' Update the text in Textbox1.
TextBox1.Text = TextBox1.Text & Microsoft.VisualBasic.vbCrLf _
& selectedEmployee & ": " & count
End Sub
1)How do I do the same for datas that are in the database(SQL Server 2000) instead? Do I have to use the below line of code? Or if not, what do I have to do to insert the data into the combo box?
Me.Inv_itemcategoryTableAdapter.Fill(Me.dsInventory.inv_itemcategory)
Inv_itemcategory is the name of the table adapter holding the data. dsInventory is the name of the data source.
2) In the second highlighted section (updating the textbox), can I use the same method to update another combo box and also a text box instead of only updating a text box?
|
|
|
|
|
1 - set the datasource of the combo box to be the datatable that contains the data, and set the DisplayMember
2 - Of course. Where are you stuck ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am calling a third party exe from my application, what I need is, can I set location, size of GUI of that exe from my web page.
thank U all..
kiran
|
|
|
|
|
Where does a web page come into it ?
If you're launching a windows app, you can get it's handle, and set the window size/position with that and C APIs which you can p/invoke.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am Thankfull for ur response.
Here I am facing 2 Problems.
1. From my ASP.Net web application I am calling an exe using javascript.
Here is my code.
var h;
h=new ActivexObject("wscript.shell");
h=run("c:\\sample.exe /v") ;
h=null;
So I am able to run it on client side. But as it is a third exe I am unable to set its location, size attributes. This was my question in ASP.Net message board. Here I pleed ur help.
2. In some other application I need to call a third party exe from my windows application. I am completely new to these C APIs, so suggest whate are the APIs to be used in what manner. Where from do I get this information.
I feel sorry for confusing you,
Thank U all,
kiran
|
|
|
|
|
From inside of a web browser? I seriously doubt you can call into the Windows API from JavaScript.
|
|
|
|
|
yes, inside a browser I am calling it, it works on client side.
|
|
|
|
|
I didnt even know it was possible to write Javascript to run an exe on the client side?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
I am using Crystal Reports 9 with Visual Basic 6.0 on Windows XP Pro.
My reports are working fine when I use them in VB IDE. But when I make an exe from the project and report button is pressed it gives "Load Report Failed" error
-----------------------------
A couple of notes:
-This is happening to all my reports
-The reports specified are added in vb6 project (reportname.dsr not and external reportname.rpt)
-This error "Load Report Failed" sometimes (rarely) appears inside vb6 IDE but when I close the project and reload the project and then first open the report in IDE and then re-run the project it (reports) again starts working fine.
Any ideas?
Thanks and regards
Kashif
|
|
|
|
|
I am using Crystal Reports 9 with Visual Basic 6.0 on Windows XP Pro.
My reports are working fine when I use them in VB IDE. But when I make an exe from the project and report button is pressed it gives "Load Report Failed" error
-----------------------------
A couple of notes:
-This is happening to all my reports
-The reports specified are added in vb6 project (reportname.dsr not and external reportname.rpt)
-This error "Load Report Failed" sometimes (rarely) appears inside vb6 IDE but when I close the project and reload the project and then first open the report in IDE and then re-run the project it again starts working fine.
Any ideas?
Thanks and regards
Kashif
|
|
|
|
|
Hi guys
I am trying to figure out why the following string is being truncated
<br />
sql = "SELECT Distinct [FundID],[Name],[Code],[Date],[ILDatabase],{fn LEFT([Code],5)},CHARINDEX({fn SUBSTRING([Code],6,1)}, 'R,U,I,C') FROM [Admin].[dbo].[ReconInstructions] A WHERE [Date] Between '" & Format(dtStartDate.Text, "DD MMM YYYY") & "' AND '" & Format(dtEndDate.Text, "DD MMM YYYY") & "' "<br />
sql = sql & "AND ILDatabase ='ILDB'"<br />
sql = sql & " ORDER BY({fn LEFT([Code],5)} ,[Date] ,CHARINDEX({fn SUBSTRING([Code],6,1)}, 'R,U,I,C') ASC)" <br />
What i get when the program runs is this
<br />
"SELECT Distinct [FundID],[Name],[Code],[Date],[ILDatabase],{fn LEFT([Code],5)},CHARINDEX({fn SUBSTRING([Code],6,1)}, 'R,U,I,C') FROM [Admin].[dbo].[ReconInstructions] A WHERE [Date] Between '01 May 2008' AND '01 May 2008' AND ILDatabase ='ILDB' ORDER<br />
The order by part of the string is being truncated. Can anyone tell me why this is happening.
|
|
|
|
|
Does VB have a max string length ? Perhaps you just think this is what you got b/c the debugger has a max string length ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes it is just the debugger that is truncating the string. I wrote the string to a file and debugged the sql in the query analyzer.
Thank you for the response
|
|
|
|
|
Dear all,
I have a problem with passing the return Boolean.This project is running with VB.NET 2003 with MySQL database. I'm using a Function to call a login verification as shown below:
Public Function FurtherUser_Authenticate() As Boolean
Dim FrmAuthen As New FrmAuthen
FrmAuthen.StartPosition = FormStartPosition.CenterScreen
FrmAuthen.Show()
End Function
And next I will prompup a form for the user to insert username and password for further verification. This will check
the user login name and password from MySQL database for verification. After success verification I would like to return
UserVerifySuccess = True to my function and the function will allowed the user to do some Setting on my window form application.
The following are the code for loading of the FormSetting which need a further user verification to login because of security issues
of the user:
Private Sub FrmSetting1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
blnMustAuthenticate = True
If blnMustAuthenticate Then
UserVerifySuccess = False
Me.Close()
Further_Authenticate()
If UserVerifySuccess = True Then
Me.Show()
End If
End If
End Sub
The code that used at FrmAuthen to check the user is allowed to do the setting is below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, pass As String
Try
ObjComm = New OdbcCommand("SELECT POS_CASHIER.LocationCode, CashierID, CashierName, Pwd, IF(POS_CASHIER.IsActive=1 AND POS_CASHIERGROUP.IsActive, 1, 0) AS IsActive, CanChangePwd, POS_CASHIER.GroupID, GroupName, IsFullAccess FROM POS_CASHIER INNER JOIN POS_CASHIERGROUP ON POS_CASHIER.GROUPID = POS_CASHIERGROUP.GROUPID AND POS_CASHIER.LocationCode = POS_CASHIERGROUP.LocationCode WHERE CashierID='" & TextBox1.Text & " ' ", ObjConn)
ObjConn.Open()
ObjRead = ObjComm.ExecuteReader
If ObjRead.Read Then
pass = ObjRead.Item(3)
x = ObjRead.Item(8)
ObjConn.Close()
If TextBox2.Text = pass Then
If x = "1" Then
Me.Hide()
Return (UserVerifySuccess = True) ' << I need to return this to my function. Thank you~!
Else
ObjConn.Close()
MessageBox.Show("Sorry. You are not allowed to run this task.")
End If
Else
ObjConn.Close()
MessageBox.Show("Your password is invalid.")
End If
Else
ObjConn.Close()
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
ObjConn.Close()
End Try
End Sub
Thats all I need someone can give me a guide whats the problem with my code here? Anyone can give me some idea/solution?
Thanks for reading.
Regards
Drex
|
|
|
|
|
drexler_kk wrote: Public Function FurtherUser_Authenticate() As Boolean
Dim FrmAuthen As New FrmAuthen
FrmAuthen.StartPosition = FormStartPosition.CenterScreen
FrmAuthen.Show()End Function
Well, this is obviously a disaster. Notice how your code doesn't return anything at all ? It's a travesty that this compiles.
Also, when you call Show(), you get a modeless form. Your app has essentially shown a login form, but lost control of it at this point. It should use ShowDialog, then check the form to find out if login succeeded, and return a bool to indicate the result.
drexler_kk wrote: ObjComm = New OdbcCommand("SELECT POS_CASHIER.LocationCode, CashierID, CashierName,.....
First of all, read up on SQL injection. This code means I can erase your database, any time I like. Second, why is it all on one line ? I guess having a variable called TextBox1 is the point at which your code stands no chance of being readable, but still.....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello Mr. Christian Graus,
I have try to change my code to the following:
Public Function FurtherUser_Authenticate(ByVal UserVerifySuccess As Boolean) As Boolean
Dim FrmAuthen As New FrmAuthen
FrmAuthen.StartPosition = FormStartPosition.CenterScreen
FrmAuthen.Show()
End Function
But I still found the error for my window frmSetting for the line of my function FurtherUser_Authenticate(). The error message appeared: Argument not specified for parameter 'UserVerifySuccess' of 'Public Function FurtherUser_Authenticate(UserVerifySuccess As Boolean As Boolean)'.
Beside,can you give me some exaple how should I solve this problem here?
|
|
|
|
|