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

Enable/Disable buttons

Good Day,
I have 2 forms with bindingNavigator 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.

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

if typeof Obj is bindingNavigator 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:
EnableDisableNavBtn(NavMain, NavMain.Item(1,2), false)

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

May 19 '07 #1
1 2051
Wan
On May 18, 11:54 pm, inad...@hotmail.com wrote:
Good Day,
I have 2 forms with bindingNavigator 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
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...
1
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...
2
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...
2
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
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 ...
6
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...
2
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...
2
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...
4
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.