Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable form but have control box remain active

Status
Not open for further replies.

STPMB

Programmer
Sep 13, 2002
28
US
Is it possible to set a forms enable property to false but still allow the control box features to remain active?
 
I do not know of any way.
Try
Private Sub Enable(blnEnabled As Boolean)
Dim ctl As Control
For Each ctl in Me.Controls
On error resume next
ctl.Enabled = blnEnabled ' Maybe leave Timer alone
On Error goto 0
Next
End Sub Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
A sure way would be to mark and cut all controls and objects on the form, put a Frame on the form, size it to the size of the form, click on this new frame, and then paste all the controls back on to it. If you start a new form, then just always make sure that you add a frame before adding controls.
Then, set the frams's border style to none.

Now you are able to do several things with this:
1. Frame1.Enabled = False will cause all of the controls on it to be disabled.

2. You can use the frame1.Move in the forms resize event to center the frame on the screen, and all of it's controls in one shot:

Frame1.Move (Frame.Parent.Width - Frame1.Width)\2, (Frame.Parent.Height - Frame1.Height)\2

3. You can hide everything as once with Frame1.Visible = False. This is good if you want two frames with two sets of controls and two command buttons to toggle between the two frames; or if there are two conditions, for the form, with little differences between them, then depending on which menu selection the user makes in the MDI, you do not need to create a new form but can use these two different states. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top