|
-
Aug 27th, 2003, 07:04 AM
#1
Thread Starter
Addicted Member
Change MenuItem Text [Resolved]
VB Code:
[color="#0000A0"]Private[/color] [color="#0000A0"]Sub[/color] mnuHidePop_Click([color="#0000A0"]ByVal[/color] sender [color="#0000A0"]As[/color] System.Object, [color="#0000A0"]ByVal[/color] e [color="#0000A0"]As[/color] System.EventArgs) Handles mnuHidePop.Click
[color="#0000A0"]If[/color] mnuHide.Text = "&Hide" [color="#0000A0"]Then[/color]
Me.WindowState = FormWindowState.Minimized
mnuHide.Text = "&Show"
[color="#0000A0"]ElseIf[/color] mnuHide.Text = "&Show" [color="#0000A0"]Then[/color]
Me.WindowState = FormWindowState.Normal
mnuHide.Text = "&Hide"
[color="#0000A0"]End[/color] [color="#0000A0"]If[/color]
[color="#0000A0"]End[/color] [color="#0000A0"]Sub[/color]
Hello.
I am trying to edit the name of a menu item when I click it. At the moment I am using the code above. With this code the text changes (When i go through it line by line), but it doesn't actually display the changes.
Anyone know the reason why?
Many thanks
Pete
Last edited by Peter1; Aug 28th, 2003 at 11:46 AM.
-
Aug 28th, 2003, 05:16 AM
#2
Thread Starter
Addicted Member
-
Aug 28th, 2003, 11:28 AM
#3
Addicted Member
Shouldn't all the references to the menu itme be named "mnuHidePop" instead of "mnuHide"? Like this:
VB Code:
Private Sub mnuHidePop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHidePop.Click
If [COLOR=red]mnuHidePop[/COLOR] .Text = "&Hide" Then
Me.WindowState = FormWindowState.Minimized
[COLOR=red]mnuHidePop[/COLOR] .Text = "&Show"
ElseIf [COLOR=red]mnuHidePop[/COLOR] .Text = "&Show" Then
Me.WindowState = FormWindowState.Normal
[COLOR=red]mnuHidePop[/COLOR] .Text = "&Hide"
End If
End Sub
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
-
Aug 28th, 2003, 11:45 AM
#4
Thread Starter
Addicted Member
Ha, whoops. Ta. You should see how many times I get stuff like that mixed up.
Thanks for your help.
Pete
-
Aug 28th, 2003, 11:34 PM
#5
Addicted Member
No problem. My theory is that if you ask enough stupid questions, you're bound to know a few answers. And I definately have asked enough stupid questions for one lifetime. I guess I was just overdue for a flash of insight.
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
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
|