473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enable/Disable buttons

Good Day,
I have 2 forms with bindingNavigato r and have a simple routine
to enable/disable navigator buttons. Each
nav button is assigned to a tag value. The problem is that if I
want to enable/disable multiple nav buttons
I have to call the routine twice.

EnableDisableNa vBtn(NavMain, NavMain.Item(1) , false)
EnableDisableNa vBtn(NavMain, NavMain.Item(2) , false)
...
Public Sub EnableDisableNa vBtn(Byval obj as Object, Byval
MenuItem as ToolStripitem, bflag as boolean...)

if typeof Obj is bindingNavigato r then...
if MenuItem.tag = 0 then
MenuItem .Enabled = bFlag
Elseif MenuItem.tag = 1 then
MenuItem .Enabled = bFlag
Elseif MenuItem.tag = 2 then
MenuItem .Enabled = bFlag ...
End sub

I would like to do it in one shot meaning:
EnableDisableNa vBtn(NavMain, NavMain.Item(1, 2), false)

Could someone please give me an example. Thanks for the advice.
Ian

May 19 '07 #1
1 2056
Wan
On May 18, 11:54 pm, inad...@hotmail .com wrote:
Good Day,
I have 2 forms with bindingNavigato r and have a simple routine
to enable/disable navigator buttons. Each
nav button is assigned to a tag value. The problem is that if I
want to enable/disable multiple nav buttons
I have to call the routine twice.
Ian,
Try the following:

NavMain.Items(0 ).Enabled = bFlag
NavMain.Items(1 ).Enabled = bFlag
....
Where bFlag is your boolean (T/F).

hth.

Wan

May 20 '07 #2

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

Similar topics

3
15948
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to enable/disable validators on the client side. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspplusvalid.asp According to it and the little other info I was able to find, the way to accomplish what I want it to call...
1
4243
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
2
8659
by: Dntc | last post by:
Hi All Is there anyway to enable/disable the toolbar buttons on the fly as like in MFC which helps centralizing this process?Let's i have a toolbar button ToolbarButtonSave which can be enabled/disabled inside the Edit control TextChanged event handler?I'm looking for a way which Toolbar can ask itself to enable/disable its buttons as ON_UPDATE_COMMAND_UI in MFC?
2
8895
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: ----------------------------- 1.> Open Device Manager(The keyboard device will have an exclamation and
1
1911
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C Select Box 1
6
5536
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be enabled only if something is selected in the listview. That part specifically works but not very well. It seems that I can only get the buttons to disable if I click off the text of the items in the listview but still within about 10-20 pixels of...
2
4366
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current Event". I go on the perticular record its enable/dosable the following field for all records. I have tried this code in "On Open Even" but there is no effect. Please help me to solve this problem.
2
2037
by: iDesmet | last post by:
Hallo, First of all, I'm new at this group and I'm currently learning VB.NET by my own (later I want to learn C#, but that's another story). In other words, I'm a Newbie. Anyway, I was wondering if someone is so kind to tell me how to enable or disable some buttons when a MdiChild Window is opened. For example, I have the Main Mdi Window opened, then I click in a
4
1703
by: anewbornman | last post by:
I want to create a login form for multiple users with different rights, and they can only see information in my queries and reports that pertain to them. For example: User1 logins in, on the switchboard I only want user1 to be able to see certain things. Then when user1 goes to see a report, it only shows user1, user1's information. Now by what I have read and can gather, I will need a user table, and that table will have to have their...
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.