|
-
Mar 29th, 2010, 07:21 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Disable everything on the form except for ONE button?
I have a form thats got a lot of buttons and functionality on it. I want some users to be able to view the form, but not have any of the functionality.
What is suppose to happen?
Everything on the form must be disabled, except for the close button.
-
Mar 29th, 2010, 07:26 AM
#2
Re: Disable everything on the form except for ONE button?
What must happen? Hummmm you will need some kind of log in function that will set user rights. Once you have that you can so one of a couple (that I can think of) things.
You move though all the controls on the form (in a for loop) and set the (1) Enabled Property to false if the control name is not the name of your close button, or (2) the Visiable property to false if the control name is not the name of your close button.
We will need more info then what you gave to give more specific instructions then that.
There are examples in the .Net forum that explain how to move though all the controls on a form.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Mar 29th, 2010, 07:57 AM
#3
Thread Starter
Addicted Member
Re: Disable everything on the form except for ONE button?
The loop function you mentioned will work perfectly. I'm a little rusty on my vb code as I did php for a couple of years now. Can you please post a simple example of above Loop?
-
Mar 29th, 2010, 08:06 AM
#4
Re: Disable everything on the form except for ONE button?
Very rough idea
vb.net Code:
For each ctl as Control in Me.Controls
'Something here
Next
There are complete examples and comments in this fourm if you do a search for them
Sometimes the Programmer
Sometimes the DBA
Mazz1
Tags for this Thread
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
|