|
-
Jan 23rd, 2003, 02:40 PM
#1
Thread Starter
Addicted Member
Have Focus set to 2 items??
What I would like to do is....
1. be clicked in the datgrid and also have focus on my textbox so that I can search for a record??
so if I was scrolling through the records in the Datagrid, and decided to search for a different part number, all I would have to do is start typing and it would be in the textbox...so that I wouldn't have to click in the textbox first before searching....
so then after I search I should just be able to press the Up/Down keys and scroll through the records in the datagrid without having to click in the datagrid?
Thanks for any help in Advance!
-
Jan 23rd, 2003, 06:02 PM
#2
Sleep mode
this might be solution . You would have hotkeys (or like) to move between the Grid and Textbox search .When you press enter key on the Grid this would trasfer you to the text and vice versa using the same key.
VB Code:
Private Sub DataGrid1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DataGrid1.KeyPress
If Asc(e.KeyChar()) = 13 Then
TextBox1.Focus()
End If
End Sub
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If Asc(e.KeyChar()) = 13 Then
DataGrid1.Focus()
End If
End Sub
-
Jan 23rd, 2003, 08:23 PM
#3
Thread Starter
Addicted Member
when I click in the datagrid...it selects whatever row I click on. But it doesn't turn the record into edit mode(where the current cell is highlighted)...so then when I press enter it works....but once I press the up/down key, then it puts my records into edit mode(where the current cell is highlighted) and then when I press enter, it doesn't work for me. So can I make it so the record doesn't go into edit mode or is there something else that can be done??
I have the datgrid set up with table styles and I can set my first column textbox to .enabled = false, and then it will work, but it doesn't look good, cause the feild is grayed out and the remaing columns are blue and yellow which look really good.
-
Jan 23rd, 2003, 08:31 PM
#4
Sleep mode
umm , When the grid is in edit mode press ESC so you can use enter key to move to textbox search ....
-
Jan 23rd, 2003, 08:36 PM
#5
Thread Starter
Addicted Member
there has to be something that will fix the problem...because the user is not going to want to press the esc key all the time to go back to the search box. What I'm trying to make it do, is when you hit the key "f" for example within the datgrid , it adds it to my textbox.text and then searches for the string in the textbox, which is working ok, except for the record going into edit mode, which is no good, cause then when the type a key, it does nothing.
-
Jan 23rd, 2003, 08:40 PM
#6
Sleep mode
would you mind stop sending me private msgs ? I'm trying to help If I can't I would say I gave up !
-
Jan 23rd, 2003, 09:24 PM
#7
Sleep mode
as long as I replied here and you feed me back here also I would get email notification . understand ? no need to do your action ... would you send me sample of your proj . zip it up !
-
Jan 23rd, 2003, 09:38 PM
#8
Sleep mode
talk to me here . right here , do you understand Neumee Last time I tell you don't send me private msg.
send it here ... I'm sorry my email is full now ....
zip your file here and I will get it then you can delete from the thread after I notify you . If you are worried about others stealing effort ...
-
Jan 23rd, 2003, 09:43 PM
#9
Thread Starter
Addicted Member
My proj uses SQL server and you dont have my Database so it's wont wokr anyway will it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|