Hello!
I'm trying to create a database application that has many tables with subtypes.
I'm only beginning to create the GUI, but i'm stuck in the most ridiculous part of it: I have a menu that has 4 options: New, Find, Update and Delete.
I divided the windows form with the split container, so that i could have on the left side the buttons and in the right side the options for each button i.e: "New" has the options "Game", "Accessory" and "Console".
Can anyone help me please?
Thank you!!!
How to create new menus from button click
Page 1 of 16 Replies - 920 Views - Last Post: 24 October 2011 - 07:55 AM
Replies To: How to create new menus from button click
#2
Re: How to create new menus from button click
Posted 21 September 2011 - 10:04 AM
So what exactly is it you want help with, I'm lost?
You want help making buttons... or a menu?
And so on.
If you look at the form1.designer.cs file you will see how Visual Studio builds all of the controls on your form for you. This is a great way to learn how they are built and added to a form.
Resources, references and suggestions for new programmers. - Updated Sep 2011
You want help making buttons... or a menu?
button demo = new button(); demo.Text = "example"; demo.Location = new Point(15, 30);
And so on.
If you look at the form1.designer.cs file you will see how Visual Studio builds all of the controls on your form for you. This is a great way to learn how they are built and added to a form.
Resources, references and suggestions for new programmers. - Updated Sep 2011
Spoiler
#3
Re: How to create new menus from button click
Posted 21 September 2011 - 12:08 PM
tlhIn`toq, on 21 September 2011 - 10:04 AM, said:
So what exactly is it you want help with, I'm lost?
You want help making buttons... or a menu?
And so on.
If you look at the form1.designer.cs file you will see how Visual Studio builds all of the controls on your form for you. This is a great way to learn how they are built and added to a form.
Resources, references and suggestions for new programmers. - Updated Sep 2011
You want help making buttons... or a menu?
button demo = new button(); demo.Text = "example"; demo.Location = new Point(15, 30);
And so on.
If you look at the form1.designer.cs file you will see how Visual Studio builds all of the controls on your form for you. This is a great way to learn how they are built and added to a form.
Resources, references and suggestions for new programmers. - Updated Sep 2011
Spoiler
Hi tlhIn`toq:
I know how to make a button, but what i still can't figure out is how to make when you click on a button a new pop-up window with new options appears. I have tried to find exactly that procedure in the internet but i haven't had any luck with it.
Example:
click on the "new" button and a new window appears with this options:
-Unique ID automatically generated.
-Name product.
-Type product----> drop-down menu with game, accessory and console options,(this i know how to do),--> In each of this submenus there are many more submenus, etc.
The only thing that i'm stuck in is the part of linking the button to a new window, which i'm pretty sure it's something really easy.
Again thank you for your time!!!
-
#4
Re: How to create new menus from button click
Posted 21 September 2011 - 01:07 PM
You need to add a new Windows Form or WPF Window (depending on which you are using) to your project that handles the logic related to adding/modifying or whatever you want to do to your database. Once you have your new form created, you need to create a new instance of the form and display the form using the click event of the button.
The code you need would look similar to this:
This is a very basic example of how to display a window triggered by a button click. You would probably want to create a new method that handles creating, showing, and handling the DialogResult and call that method from the button click.
The code you need would look similar to this:
private void addButton_Click(object sender, EventArgs e)
{
AddNewEntryForm anf = new AddNewEntryForm(); // the new instance of your entry form class
anf.Show(); // you can use ShowDialog here if you want the AddNewEntryForm window to display modally
}
This is a very basic example of how to display a window triggered by a button click. You would probably want to create a new method that handles creating, showing, and handling the DialogResult and call that method from the button click.
#5
Re: How to create new menus from button click
Posted 22 September 2011 - 06:15 AM
Given your two pane design I wouldn't make a form.
I would design UserControls instead of forms.
When you click the button, make a new instance of the UserControl and place it in your right side pane.
I would design UserControls instead of forms.
When you click the button, make a new instance of the UserControl and place it in your right side pane.
#6
Re: How to create new menus from button click
Posted 24 October 2011 - 07:43 AM
#7
Re: How to create new menus from button click
Posted 24 October 2011 - 07:55 AM
think about it like a web site navigation. when you click a link the content changes. Try to implement that in your design by using user.controls.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|