Adding a main menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new at this and read the help on how to add a menu to my pocket PC
application.

I got as far as dragging it from the toolbox to the form and adding a few
options, but now I do not know how to get the form to use it and how to
enable the E&xit and M&inimize selections that I added to it.

I am sure the documentation is there somewhere, I just can't find it. What I
have read assumes something that I am just not understanding or something.

Can someone point me the right way?
 
Did you drag a MainMenu or a ContextMenu? It is the former you probably want
for your form...

Cheers
Daniel
 
1. Open form in VS Designer
2. Choose property MainMenu on Forms property page and assign your menu
(type menu name or select in dropdown list)


or type
myForm.MainMenu = mainMenu1; // your added menu control
 
OK I guess I got that much done alerady.

But to make the items on the form functional I know I need to add some stuff
in the code behind on a click event, I don't know what that would be.

It is weird trying to do something so basic as to add a menu and not have a
clue. The app already does data snyc aand replication add delete update all
that. It is funny the stuff you can get stuck on. It is a unusual 1st
application to write in a .net environment.

L.
 
So you have a MainMenu with MenuItems on it and it is associated with the
Form? Now double click on the MenuItems of interest (e.g. Exit) and it will
take you to an event handler method in the code behind. There you can add
you logic.

Cheers
Daniel
 
Yep I know that, but the basic problem is I don't know how to minimize an
application using the code behind, or exit it either for that matter. Stupid
eh?

I know it can't be a big deal, it is the most fundamental of operations.

I am sure it is like one line of code or something like me.minimize or some
weird thing.
 
Look at the Form.Close method and the Form.Closing event (and the e.Cancel
property that you can set)

Also note that if you set the Form.MinimizeBox to true you app minimises
whereas if you it is False it really closes when user clicks in the top
right corner.

Cheers
Daniel
 
Thanks. I sort of liked having the X close the app because that is what
people in the desktop world are used to it doing. But then I needed a way to
minimize it in case they forgot to turn the scan wedge on before they started
the application because they need to scan bar codes into fields within the
app.

I am not really sure why pocket apps just minimize on the x instead of
close. Seems like they would want to be sure if a user was done with
something that it really did close instead of lurk around like that, what
with the limited resources of the pocket.
 
If the form minimize box is set to true and they use it, how then do they get
the thing back up again?
 
The same way they get back any other PPC built-in or not app that they
minimize. E.g. via start menu, or the Settings->Memory->running apps window,
or by minimizing/closing other apps etc.

Cheers
Daniel
 
Back
Top