|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can't seem to get AcceptButton working when changed in code?Hi,
I have a search for where we want the user to enter the search criteria in at the top and press enter, then the results are shown in a datagrid which we set the focus to. Once they select the item they want to choose then they press enter to accept the form. The problem is when you go into the form butSearch is set to AcceptButton for the form, once you have selected the search criteria to populate the data grid then we want to make butOK the AcceptButton for the form. The butOK does have the highlight round it to say its the default button but once you set it in code you can't even click on it with the mouse? Anyone got any ideas? Thanks Mike sonicm wrote:
Show quoteHide quote >Hi, Just a suggestion:> >I have a search for where we want the user to enter the search criteria in >at the top and press enter, then the results are shown in a datagrid which we >set the focus to. Once they select the item they want to choose then they >press enter to accept the form. > >The problem is when you go into the form butSearch is set to AcceptButton >for the form, once you have selected the search criteria to populate the data >grid then we want to make butOK the AcceptButton for the form. > >The butOK does have the highlight round it to say its the default button but >once you set it in code you can't even click on it with the mouse? > >Anyone got any ideas? >Thanks >Mike > > Don't have any acceptbutton. If the user is in the search box, keypress 13 ( <ENTER> ) causes the search, as well as clicking the search button. If the user is in the grid, keypress 13 causes accept action, as well as clicking the accept button. Tom > Just a suggestion: Yeah I did think of that but thought I'd try to use the AcceptButton as its > > Don't have any acceptbutton. > If the user is in the search box, keypress 13 ( <ENTER> ) causes the > search, as well as clicking the search button. > If the user is in the grid, keypress 13 causes accept action, as well as > clicking the accept button. > > Tom neater. Looks like a bug in .NET 2003 then. Ok i'll use they keypress instead. Thanks for your help Mike
Checked Listbox?
retrieve rows from datagridview into a separate datatable? Moving Splitter Throws Exception Obscure Text in Textbox MDI Simple Question about two forms Form getting maximize PictureBox with shortcut possible? How to use PDF file for online help from VB.Net windows app Cannot fully access My namespace facility in VS 2005 |
|||||||||||||||||||||||