473,378 Members | 1,138 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,378 software developers and data experts.

Q: Autogenerating menus and executing forms.

Hi!

I have an SQL table containing a menu number, level, title and formname.
What i want to do is to generate the menu automaticly from the table, and
set
the onclick event to execut the form from the given name of the table...

Example of table

ID Level Title FormName
1 0 System -
2 1 Settings frmSettings
3 1 Statistics frmStatistics

when generating this menu i want a single onklick event and when that fires,
show
the frmSettings or the frmStatistics...

In a 4GL language i used there was an eval function to be used, but now i am
lost since i am kind of new to the c# language

Any help or ideas?

Regards

Martin
Nov 17 '05 #1
2 1082
My 2 cents;

Create a win form and drop in a menu with no collection items in it.
During initialisation, read the sql table and add each item to the menu
you have added previously in the windows. For click events, I would
suggest write one static method which you tie for all the menu click
and in the method, you identify the sender item and do your work based
on the value.

Thanks.

Nov 17 '05 #2
My 2 cents;

Create a win form and drop in a menu with no collection items in it.
During initialisation, read the sql table and add each item to the menu
you have added previously in the windows. For click events, I would
suggest write one static method which you tie for all the menu click
and in the method, you identify the sender item and do your work based
on the value.

Thanks.

Nov 17 '05 #3

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

Similar topics

7
by: Jason Webb | last post by:
Dear Microsoft, The current "Windows.Forms" controls included in the .Net Framework are good, but in many ways they're pretty basic, and I think it's time that you take Windows.Forms to the...
4
by: Karl Irvin | last post by:
In a 2000, can you transfer custom menus and toolbars to a new Access database. My mdf file is not compiling and I'm importing all data to a new database but don't see a way to get the...
1
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
0
by: cefrancke | last post by:
I recently discovered, that if you set the startup options for "security", you will have alot of work do to get Access back to "normal". If you disable the built-in menus/toolbars you'll have to...
0
by: Keith | last post by:
When merging two menus, it doesn't actually merge their sub menus and menu items It only displays two menus on one forms instead of merging two sub menus into one if they have sam menu text ...
0
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
3
by: Steven Smith | last post by:
the way I'm undersatnding the MSDN documentation when creating parent and child forms the main menu for the child form should not be displayed on the child form itself but instead be incorporated...
4
by: Marcin Zmyslowski | last post by:
Hello! How to prevent from autogenerating chart after opening a form with a chart? I would like to set chart parameters which are located in a form, and then click on a button which let me...
7
by: Brave | last post by:
I have two questions about pulldown menus on forms. 1: Can I have the options of one pulldown menu be dictated by the choice from another pulldown menu (example beow)? 2: Can I have a form be...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.