473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Finish textbox and grid editing on Menu click ?


This seems like an obvious one but it has me stumped.

I have a complex form with a bunch of databound grids and textbox
controls. There is a MainMenu control, and a toolbar control with
shortcuts to some of the most common commands - for instance, Save.

When I click on a toolbar control, I can catch the ItemClick event and
do a toolbar.Focus call to switch focus to the toolbar, thereby
pulling focus from whatever input control was previously focused.
This allows the LostFocus event to finish up whatever editing
operation was in, so that the Save command executes with all object
fields updated correctly.

But I can't figure out how to trap a similar event on the MainMenu
item. Do I really have to put a Focus call into every MenuItem.Click
event? That seems rather hacky; I'd be surprised if there's no way
to determine that the MainMenu has been clicked on or received focus
or something?

thanks!

elijah
Feb 16 '08 #1
2 1357
elijah,

I really cannot get what is your goal.

It sounds as it is the EndEdit (for version 2003 EndCurrentEdit because
there EndEdit has a bug) what you are looking for.

That pushes all data in the controls to the datasource.

Whatever focus there is on. (I am talking about Microsoft controls, I know
controls with bugs who don't do this).

Cor

Feb 16 '08 #2
ok - my goal is to pull focus from whatever control has it, when any
menuitem is clicked. This is so that the control with focus at the
time can validate before the menu command executes.

With the toolbar, I can handle the ItemClick event and execute
Toolbar.Focus to get this done. I'm wondering how to do a similar
thing with a MainMenu control, without putting code into every
MenuItem click event...
Feb 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shravan | last post by:
Hi, I saw that in Windows Forms DataGrid with new row creation set to true, if I have added a new row earlier which was empty and deleted the row and shifted the focus to any other control and...
1
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
1
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
0
by: Norbert | last post by:
Hi Can anybody help me ? I try to show popup menu when the right mouse button is clicked on ModHfGrid. I see the popup menu but when I click any option the click event of menuitem is not fired....
2
by: Mad Scientist Jr | last post by:
I am editing an existing application that has a System.Windows.Forms.TreeView with a right-click menu with several options. I want to get rid of the TreeView alltogether and rip out the code for...
0
by: mutlyp | last post by:
I have a PreRender event to set the width of my textbox when the Edit button is pressed on my grid here is the code: Private Sub grdPBC_PreRender(ByVal sender As Object, ByVal e As...
2
by: johnlim20088 | last post by:
Hi Someone please help me string typ; if (e.Row.RowType == DataControlRowType.DataRow) { typ = e.Row.Cells.Text;
0
by: rehanmomin | last post by:
Just to start off, I am writing a web application using C#. I have a Menu which is binded to an XML datasource. There are three menu items each with submenus and a textbox where I want to display...
2
by: mrutyunjaya | last post by:
hello, i have two textbox column and one button control in gridvie when i click button it will ask plese enter price in first textbox . when enter values it is asking again. how to pass...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.