|
-
Jun 16th, 2009, 02:41 AM
#1
Thread Starter
Hyperactive Member
MenuBar Manipulation
hi,
I want to know to how to delete duplicate items in menubar?
-
Jun 16th, 2009, 02:50 AM
#2
Re: MenuBar Manipulation
Why does this menu have duplicate items in the first place? Wouldn't it make more sense not to add them to begin with rather than removing them afterwards?
-
Jun 16th, 2009, 03:05 AM
#3
Thread Starter
Hyperactive Member
Re: MenuBar Manipulation
actually when form loads i will create menus based on data present in Database.. when user edits that data, at that time i want to update the edited/Newly added data in Menu bar.. really confused in this silly thing..
-
Jun 16th, 2009, 03:21 AM
#4
Re: MenuBar Manipulation
It's fairly simple. Before you add a menu item you test to see whether a matching item already exists and you just don't add one if it does. To do that you might loop through the existing items and test the Text property of each or whatever, or you might keep a list of the existing data elsewhere for easier access. It depends on your preference and the specific circumstances. You've only given us a very vague description of the circumstances so I can't really say more than that.
 Originally Posted by yogesh12
really confused in this silly thing..
The most common cause for confusion in beginners (and others) is that they start trying to write code before they even know what the code is supposed to do. That's just never going to work. You need to work out the logic first, then write code to implement that logic. You should start out asking yourself how you would go about performing the task manually, say with pen and paper or with physical objects. Once you've got a set of steps that you can run through physically and get the correct result, only then should you consider writing any code. At that point you can write code to specifically implement the steps you worked out before, so you know exactly what your code is supposed to do and the opportunities for confusion are reduced dramatically.
-
Jun 16th, 2009, 03:32 AM
#5
Thread Starter
Hyperactive Member
-
Jun 16th, 2009, 03:35 AM
#6
Re: MenuBar Manipulation
What exactly is the source data? What exactly constitutes a duplicate?
-
Jun 16th, 2009, 03:40 AM
#7
Thread Starter
Hyperactive Member
Re: MenuBar Manipulation
i have two form, form_main is main form, in load even of main form i am extracting data from db and creating menu items and adding them.. i have another form which is used to edit/Add new data... when form loads i am calling a fucntion which adds menu itms from db.. and in another for Config_items i am probiding user to edit/add data.. after editing or adding data i want to update DB (which i can do) and want to update form_main`s menubar..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|