|
-
June 15th, 2000, 10:21 AM
#1
Command button Reuse
I have a form with a command button named 'Compute'.After the user clicked to compute and the results generated,I set certain properties on my output text box (Locked=True and ForeColor=vbYellow)and my Compute button caption to change to 'Try again'
I would like to use the SAME button to do another computation.I wish to toggle the properties on the text box which I've just changed and the button to read as 'Compute' again.
Do you think this is possible ? Pls enlighten me.
Lots of thanks.
-
June 15th, 2000, 10:31 AM
#2
Re: Command button Reuse
This should work
sub compute_click
select case compute.caption
case "Compute"
' do your computation
txt.Locked = true
txt.ForeColor = vbYellow
compute.caption = "Try Again"
case "Try Again"
compute.caption = "Compute"
' do your computation
txt.Locked = false
txt.ForeColor = ???
end select
end sub
-
June 15th, 2000, 09:08 PM
#3
Re: Command button Reuse
If you don't mind using two command buttons, you can place both of them in the same position and toggle the visible property.
private sub cmd1_click()
cmd2.visible = true
cmd1.visible = false
end sub
private sub cmd2_click()
cmd1.visible = true
cmd2.visible = false
end sub
David Paulson
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
|