Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default How to disable all controls in form?

I'd like to disable a large number of controls and enable a small number of
controls (within a frame in a multipage) when click a button.

I'm guessing the quickest way to do this is to disable all controls then
enable the ones I need in code? But I don't know how to disable all controls
in a short way. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default How to disable all controls in form?

hi, Sam !

I'd like to disable a large number of controls and enable a small number of controls
(within a frame in a multipage) when click a button.
I'm guessing the quickest way to do this is to disable all controls then enable the ones I need in code?
But I don't know how to disable all controls in a short way. Any ideas?


for sure, it will depend on...
- the number (and type) of controls you need to (dis/en)able
- the layout/location/arrangement/... for these controls
- the conditions to decide which control/s shall be (dis/en)abled
- *IF* you need to control all of the above with a single button
- ???

a quick way could it be Label-controls ABOVE each "group" of controls
(set a "transparent" BackStyle and a "no border" BorderStyle for the Label-controls)
and use your button_events to handle it's .Zorder property (i.e.)

assuming only two goup of controls, each of them with a Label-control ABOVE
and two ToggleButtons to handle the .ZOrder property
try the following lines in your UserForm code module (adapt/modifi/... as needed)

Private Sub UserForm_Initialize()
Label1.ZOrder 0
Label2.ZOrder 0
End Sub
Private Sub ToggleButton1_Click()
Label1.ZOrder -ToggleButton1
ToggleButton1.Caption = IIf(ToggleButton1, "Dis", "En") & "able Group 1"
End Sub
Private Sub ToggleButton2_Click()
Label2.ZOrder -ToggleButton2
ToggleButton2.Caption = IIf(ToggleButton2, "Dis", "En") & "able Group 2"
End Sub

hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default How to disable all controls in form?

Hi Hector

Having read through your reply, I came to realise that perhaps it's better
(and easier) for me to disable all multipage tabs other than the one tab in
which the controls needs to be enabled, than to try and disable all controls.

Thanks for your thoughts!

Sam



"Héctor Miguel" wrote:

hi, Sam !

I'd like to disable a large number of controls and enable a small number of controls
(within a frame in a multipage) when click a button.
I'm guessing the quickest way to do this is to disable all controls then enable the ones I need in code?
But I don't know how to disable all controls in a short way. Any ideas?


for sure, it will depend on...
- the number (and type) of controls you need to (dis/en)able
- the layout/location/arrangement/... for these controls
- the conditions to decide which control/s shall be (dis/en)abled
- *IF* you need to control all of the above with a single button
- ???

a quick way could it be Label-controls ABOVE each "group" of controls
(set a "transparent" BackStyle and a "no border" BorderStyle for the Label-controls)
and use your button_events to handle it's .Zorder property (i.e.)

assuming only two goup of controls, each of them with a Label-control ABOVE
and two ToggleButtons to handle the .ZOrder property
try the following lines in your UserForm code module (adapt/modifi/... as needed)

Private Sub UserForm_Initialize()
Label1.ZOrder 0
Label2.ZOrder 0
End Sub
Private Sub ToggleButton1_Click()
Label1.ZOrder -ToggleButton1
ToggleButton1.Caption = IIf(ToggleButton1, "Dis", "En") & "able Group 1"
End Sub
Private Sub ToggleButton2_Click()
Label2.ZOrder -ToggleButton2
ToggleButton2.Caption = IIf(ToggleButton2, "Dis", "En") & "able Group 2"
End Sub

hth,
hector.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Is it possible to disable two or more controls from the same toolbar, when those cont Andoni[_50_] Excel Programming 0 September 16th 04 02:28 PM
Enable and disable worksheet controls? William Deleo Excel Programming 8 December 23rd 03 12:59 PM
Disable app window controls JC[_7_] Excel Programming 0 November 25th 03 09:52 PM
Disable controls on spreadsheet manishc Excel Programming 1 November 16th 03 11:08 AM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"