P
paulotuatail
Hi. I would like to add a simple menu to my app. For starters the simple Help -> about my app with copy write info. I take it this is a pop up form?
TIA
Desmond.
TIA
Desmond.
Hi. I would like to add a simple menu to my app. For starters the
simple Help -> about my app with copy write info. I take it this is a
pop up form?
[...]
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
MainMenu mm = new MainMenu(); [...]
Note that MainMenu is unofficially deprecated in favor of the newer
MenuStrip functionality.
Not that any of the Windows Forms API is really anything other than
backward-compatibility at this point, but a MenuStrip-based menu is
technically the "more current" paradigm to use in .NET.
And of course, whichever one uses, it's easier to configure the menu in the
Designer itself, rather than hard-coding everything in the constructor.
Depends on the kind of menu and what you're using for your GUI. If you're
actually using the System.Windows.Forms objects (as your posts seem to
imply), then you're looking the MenuStrip control in the VS Designer
Toolbox. Once you've dragged that to the window, then you can start adding
menu commands just by clicking in the MenuStrip at the appropriate places.
By the way, note that for Windows Forms applications, when you use the "Add
New Item" dialog, there's an "About Box" type (found in the "Windows Forms"
category) that automatically populates itself with information in your
application properties.
Pete
Hi. I would like to add a simple menu to my app. For starters the simple Help -> about my app with copy write info. I take it this is a pop up form?
TIA
Desmond.
Ok I am getting closer now. Some of thouse google websites are rubbish. I have an about box: AboutInterest.cs and a html page: Support.html
I added the L on the end as i like that way. So to the very few problems
1) When I run the program I get the default about box from Microsoft which is strange.
2) I would like to position the About box ofset by 50 pixels so tha app can be slightly visible. Problems with .Right propery here
3) I would like to pop ub the html instructions preferably resizing and positioning th browser.
Thanks for all your help here. I wrote this originaly in VB^ and it worked fine. Here is the code section I need help with
Thanks
private void About_MenuItem_Click(object sender, EventArgs e)
{
Form frm = new AboutInterest();
//int x = (this).Left;
//int y = (this).Right;
frm.Left = (this).Left + 50;
//frm.Right = (this).Right + 50; // Doesn't like this line?
frm.ShowDialog(this);
}
Yes, true it does. I'm not saying the code itself is different. It's just
easier to "write" the code via the Designer than to do it all by hand.
Hi. I would like to add a simple menu to my app. For starters the simple Help -> about my app with copy write info. I take it this is a pop up form?
TIA
Desmond.
frm.ShowDialog(this);
About
Instructions
private void About_MenuItem_Click(object sender, EventArgs e)
{
Form frm = new AboutInterest();
//int x = (this).Left;
//int y = (this).Right;
frm.Left = (this).Left + 50;
frm.Right = (this).Right + 50; // Doesn't like this line?
frm.ShowDialog();
}
private void instructions_MenuItem_Click(object sender, EventArgs e)
{
// HtmlDocument h = new HtmlDocument();
}
frm.Right = (this).Right + 50; // Doesn't like this line?
# What does "Doesn't like this line" mean?
I am a newby to this please understand.
I don't know what you consider the dividing line between "simpler" and "non
simple" usage. But I can tell you that I've never had to code a
non-dynamic menu in Windows Forms that would have been faster to do by hand
than to just configure it in the Designer.
But regardless, I think it's safe to assume that the OP is interested in
"simpler" usage, and so it makes more sense to focus answers with that in
mind.
[...]I don't know what you consider the dividing line between "simpler" and "non
simple" usage. But I can tell you that I've never had to code a
non-dynamic menu in Windows Forms that would have been faster to do by hand
than to just configure it in the Designer.
How do you tell the designer to use the result from a method to generate
a menu?
<sigh>
What do you think I mean by "non-dynamic"?
Whatever.
I didn't _assume_ anything about what the OP is interested in.