|
September 10, 2002 Implementing Windows Form's Menus Tips: September 2002
Yehuda Shiran, Ph.D.
|
|
Continuing our example from yesterday, we first initialize menuSave, then menuFile, and finally menuMain. Here is the definition of menuSave:
The event handler of a Click event is menuSave_Clicked. We just pop up a message box as a response to the Click event:
We continue with the initialization of menuFile. We can now add the previously-initialized menuSave:
We finish the menu creation by initializing the top menu bar and adding menuFile to it:
The package name is MenuPkg and the class name is MenuCls. We pop up the windows form by calling Application.Run():
You should get the following window:
People who read this tip also read these tips: Look for similar tips by subject: |