peanut1010
asked on
vb.net change toolbar from another form
I have a login box called frmlog and I want to have the user log in and if corret loginname and password then show a toolbar button that is invisible.
Now I have a mdiform and the frmlog is a child
so I tried this
under my ok button:
if text = "name" and pass = "Pass" then
dim mdiform as mdiform
mdiform.toolbar1.buttons.i tem(2).vis ible = true
end if
I get an error
then I tried:
if text = "name" and pass = "Pass" then
dim mdiform as new mdiform
mdiform.toolbar1.buttons.i tem(2).vis ible = true
end if
no error but nothing happens
what am I doing wrong????
Now I have a mdiform and the frmlog is a child
so I tried this
under my ok button:
if text = "name" and pass = "Pass" then
dim mdiform as mdiform
mdiform.toolbar1.buttons.i
end if
I get an error
then I tried:
if text = "name" and pass = "Pass" then
dim mdiform as new mdiform
mdiform.toolbar1.buttons.i
end if
no error but nothing happens
what am I doing wrong????
ASKER
doesn't work I get a blue line under
Me.Parent.toolbar1
error states not a member of 'System.windows.form,contr ol
The code for frmlog calling is
I have a toolbar that says Log.
The user clicks on log it runs this
dim frmlog as new frmlog
frmlog.mdiparent = me
frmlog.show
then under the ok button on the frmlog I tried your suggestions:
if text = "name" and pass = "Pass" then
Me.Parent.toolbar1.buttons .item(2).v isible = true
end if
but like I stated I get that error
Me.Parent.toolbar1
error states not a member of 'System.windows.form,contr
The code for frmlog calling is
I have a toolbar that says Log.
The user clicks on log it runs this
dim frmlog as new frmlog
frmlog.mdiparent = me
frmlog.show
then under the ok button on the frmlog I tried your suggestions:
if text = "name" and pass = "Pass" then
Me.Parent.toolbar1.buttons
end if
but like I stated I get that error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nope, does nothing. I am a little lost though why would u use
dim f as form1. I don't even have a form1. I changed it to frmlog. but still got error.
Please try this:
Go to vb.net and create new project have two forms .
name the 1 form frmmdi and the other frmlog
now on the frmmdi add a toolbar and add a button with text= "Boy"
Now then go to the properties and select True for IsMdiContainer.
Now for frmlog go and add 1 textbox and a button.
Write this for the button
if textbox1 = "day" then
'this is the part where I need to change the toolbarbutton from Boy to Girl
end if
dim f as form1. I don't even have a form1. I changed it to frmlog. but still got error.
Please try this:
Go to vb.net and create new project have two forms .
name the 1 form frmmdi and the other frmlog
now on the frmmdi add a toolbar and add a button with text= "Boy"
Now then go to the properties and select True for IsMdiContainer.
Now for frmlog go and add 1 textbox and a button.
Write this for the button
if textbox1 = "day" then
'this is the part where I need to change the toolbarbutton from Boy to Girl
end if
form1 mean the main form
I am just testing the code. so I set the main form as form1
I am just testing the code. so I set the main form as form1
sorry for the name different between us
you should set form1 to mdiform
I just review the problem you published
you should set form1 to mdiform
I just review the problem you published
ASKER
worked great. I am lost though what does the f represent. really confussing I can't wait until vb 8. I have been playin with it and this stuff is easier.
your welcome
exchange our knowledge make us skillfull
exchange our knowledge make us skillfull
Something like:
if text = "name" and pass = "Pass" then
Me.Parent.toolbar1.buttons
end if
Idle_Mind