Results 1 to 9 of 9

Thread: Have Focus set to 2 items??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154

    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!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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:
    1. Private Sub DataGrid1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DataGrid1.KeyPress
    2.         If Asc(e.KeyChar()) = 13 Then
    3.             TextBox1.Focus()
    4.         End If
    5.     End Sub
    6.  
    7.     Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
    8.         If Asc(e.KeyChar()) = 13 Then
    9.             DataGrid1.Focus()
    10.         End If
    11.     End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154
    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.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    umm , When the grid is in edit mode press ESC so you can use enter key to move to textbox search ....

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154
    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.

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    would you mind stop sending me private msgs ? I'm trying to help If I can't I would say I gave up !

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 !

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 ...

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    154
    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
  •  



Click Here to Expand Forum to Full Width