|
Hello,
The code works but the when you use the Enter key the program Beeps at me and I would like to stop that but still move to the next control.
Private Sub controls_KeyDown(ByVal Sender as object, BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown<br />
If e.keyCode = Keys.Enter Then<br />
Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False)<br />
End If<br />
End Sub
I have also tried many variations of code that is in the if block like SendKeys.Send("{TAB}") still makes the Beep
Thank you
Dale Burmeister
|
|
|
|
|
The Enter and Tab keys are making noise because they are not valid keypresses at the time. Do you have all of your controls TabStop properties set to False? There is a condition setup somewhere that is making the default keyboard handlers (not your handlers!) in the form think that the keypress is not valid and, therefore, generates a beep to signal such an error.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The Tab key work just fine and does not Beep the Enter key Beeps only when it exits the if statement. All the TabStop properties on the ComboBoxes and TextBoxes set to True. The GroupBoxes the house the Combo and TextBoxes to do not have a TabStop properties (I think they are false all the time). The only other event that I have code in is SelectionChangeCommitted for the ComboBoxes and that I use to change a bunch of other things when it happens.
I don't think I have any setup condition that touches the default keyboard handlers.
Also the wired thing is that the Tab key does not fire the keyDown Event.
Thank you for you help
Dale Burmeister
|
|
|
|
|
Try using the following code instead, it should work!
(I haven't checked if it works or not.)
<code>Private Sub controls_KeyDown(ByVal Sender as object, _
BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown
If e.keyCode = Keys.Enter Then
e.Handled = True
Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False)
End If
End Sub
</code>
|
|
|
|
|
Yep just tried it still a beep also the SelectNextControl returns a Boolean and that also gives me a beep.
Thank you for you help
Dale Burmeister
|
|
|
|
|
how to search for data in msflexgrid. i want user to enter the criteria in a textbox . The pass the text to SQL statemet.
StrSql = "select * from address where co_name LIKE " & txtquery.text & ""
Adodc2.RecordSource = StrSql
the above code does not work .
please help me how to solve this problem.
|
|
|
|
|
moon99 wrote:
StrSql = "select * from address where co_name LIKE " & txtquery.text & ""
Your forget the ' character at the beginning and ending of your search string. Your code should be:
StrSql = "select * from address where co_name LIKE ' " & txtquery.text & "' " but it just query the data from your table only.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
|
HI All,
I have a simple program where I insert values into a Sql Database.
The following is my INSERT code:
Public SqlConn As New SqlConnection()<br />
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click<br />
<br />
SqlConn = New SqlConnection("Data Source=SOORAJ;Initial Catalog=TrackEmp;User Id=sa; Password=; ")<br />
Dim cmdText As String = "INSERT into EmpMaster(Name, Age, Gender, Address, TelephoneNo, MaritalStatus, Salary, Post,Department) Values ('" & txtName.Text & "','" & txtAge.Text & "','" & gSex & "', '" & txtAddress.Text & "', '" & txtPhone.Text & "','" & mStatus & "', '" & txtSalary.Text & "','" & txtDesignation.Text & "', '" & txtDept.Text & "')"<br />
SqlConn.Open()<br />
Dim cm As New SqlCommand(cmdText, SqlConn)<br />
cm.ExecuteNonQuery()<br />
SqlConn.Close()<br />
MsgBox(" The Employee has been Added")<br />
txtName.Text = ""<br />
txtAge.Text = ""<br />
txtAddress.Text = ""<br />
txtPhone.Text = ""<br />
txtSalary.Text = ""<br />
txtDesignation.Text = ""<br />
txtDept.Text = ""<br />
End Sub,
I have 3 tables in my Database.
Can someone tell me how to go about with the UPDATE And DELETE.
Thanks and Regards,
lis
Thinking is like loving and dying.
Each of us must do it for himself.
|
|
|
|
|
|
Hi,
It is not the statement I want but that my following code is giving me error.:
<br />
<br />
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click<br />
SqlConn = New SqlConnection("Data Source=SOORAJ;Initial Catalog=TrackEmp;User Id=sa;Password=; ")<br />
Dim cmdText As String = "DELETE FROM EmpMaster where [Name] ='" & txtName.Text & "'"<br />
SqlConn.Open()<br />
Dim cm As New SqlCommand(cmdText, SqlConn)<br />
cm.ExecuteNonQuery()<br />
SqlConn.Close()<br />
MsgBox(" The Record has been Deleted")<br />
End Sub<br />
This is the error it is giving me
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Can someone tell me where I am going wrong??
thanks and regards,
lis
Thinking is like loving and dying.
Each of us must do it for himself.
|
|
|
|
|
I have icons in file dll
but I can't load icon to dll from my program
help me.
thanks
thanks for codeproject
|
|
|
|
|
Make sure your icons are set to be embedded resources by going to the properties of each icon you wish to include. Then, you can access the icon by the namespace of the DLL using the constructor for the icon class.
Dim myIcon as Icon
myIcon = New Icon(GetType(Company.MyProgram),"MyIcon.ico")
The full namespace for the icon is: Company.MyProgram.MyIcon.ico
Build actions for embedded resources are documented in the MSDN Library http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconfileproperties.asp[^].
|
|
|
|
|
Hi, is it possible to have a VB.NET application start up another application on a remote PC? I need my application (writing in VB.NET) to start up MS Word on two remote PC's everyday. Can someone please point me to a good tutrial on this or show me an example of the code that you would need to do this? I can get it to start the application on my machine but not on the remote one...
Any help wil be GREATLY appreciated.
Thanks
|
|
|
|
|
Remote execution is a HUGE security risk!
In order for Word to run, it requires a user account to be logged in. Why not just put Word in the Startup folder of All Users?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hai
I have created the coloum headers for the list view now i want to change the backcolor of the coloum header how can i do this in vb.net
Thanku
lakshmi kala
|
|
|
|
|
Not supported by normal means. You'll have to owner-draw the ListView yourself. The article search is taking awy too long to come back with results right now, but search the articles for "custom Listview" and you'll find a bunch of example on how to owner-draw a listview control.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanku for u response
kala
|
|
|
|
|
Hai,
i'm using 3 form Search,Edit,Add. After adding records in the database by dataset i'm using Search form to show records, clicking on a particular record shows it's content on the edit form. Now the problem is that i want to update that particular row in the dataset and then reflect changes to the database, How can i do that.
Thanks
Nitin
|
|
|
|
|
i have 2 text files. i need to compare both of them by line by line. if diferent then i have to prompt out msg box.
below are part of my code. i have change my code, because before i compare my string i need the file be able to read and loop. currently i have the problem of looping for all the staterment in the text files.
I mean the first line in the text file to loop with the entire of statement in text file 2. then the second line of the text file loop with the entire statement of text file 2.
thanx.. i know the code is messy the post is confusing, but i really tried my best...
Private Sub Command1_Click()
Dim lblA(1 To 10)
Dim lblD(1 To 10)
Dim k(1 To 3) As String
Dim l(1 To 10) As String
Dim line As String
Dim lines As String
i = 1
Open "D:\Documents and Settings\studentadmin\Desktop\Testing.txt" For Input As #1
Open "D:\Documents and Settings\studentadmin\Desktop\Test.txt" For Input As #2
If Not EOF(1) Then
Input #1, line
k(i) = line
lblA(i) = Trim(Left(k(i), 10))
End If
While Not EOF(2)
Input #2, lines
l(i) = lines
lblD(i) = Trim(Left(l(i), 10))
MsgBox lblA(i) & lblD(i)
Wend
Close #1, #2
End Sub
|
|
|
|
|
There are so many things wrong with this code, I don't know where to start! It desperately needs a complete rewrite. Unfortunately, if anyone here rewrote it for you, your instructor would know you didn't write it!
First, your using a for loop to read a file - don't! Use a counter and increment it for each line that you read. Use the EOF() function you used in your first loop. You'll do this twice (You actually doing this twice - once for each file.)
Next, you don't have a single if statement in this code. Where are you doing your compare?
Lastly, overhaul your design. Open one file, read it into an array, then close it. Open the next file, read it into another array, then close it. Then go through your arrays and compare them, one line at a time. If the lines are different, then show a Messagebox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
can any one tell me
1) how can i reach to Yahoo messenger from my vb.net
program and identify add and remove ID and ... and how can i send & recieve
message from my program to/from other yahoo messenger id?
(Port number that yahoo used and ...)
2) how can i make my id that used in my program always on?
i hope you understand what i mean !!!!
Best Regards
M.Khayatan
MkhProgrammer
|
|
|
|
|
These questions are specifc to Yahoo functionality and must be directed to them.
They have nothing to do with VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Do you somebody know how do,to at clicks right mouse button on filename in list showed shell context menu as in explorer?
Thank´s
PS: Sorry,I´m not form england,so my english isn´t very good.
|
|
|
|
|
You can't use the Shell's context menu in your application since your application is not part of the Shell.
There is nothing stopping you from writing your own context menu though.
Are you using VB6 or VB.NET?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|