By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,060 Members | 1,906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,060 IT Pros & Developers. It's quick & easy.

Enable/Disable buttons

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.