View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
monir monir is offline
external usenet poster
 
Posts: 215
Default User Form Interface .... really a simple question!

Dave;

Thank you for your help! It works. Will review Debra's link shortly.



"Dave Peterson" wrote:

How about something like:

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub OptionButton1_Click()
Me.OptionButton3.Enabled = True
Me.OptionButton4.Enabled = False
Me.OptionButton5.Enabled = False
End Sub
Private Sub OptionButton2_Click()
Me.OptionButton3.Enabled = False
Me.OptionButton4.Enabled = True
Me.OptionButton5.Enabled = True
End Sub
Private Sub UserForm_Initialize()
Me.OptionButton3.Enabled = False
Me.OptionButton4.Enabled = False
Me.OptionButton5.Enabled = False
End Sub

Debra Dalgleish has a getstarted with userforms at:
http://www.contextures.com/xlUserForm01.html




monir wrote:

Fantastic! Thank you very much.

Now the user interface works fine, as far as clicking the various option
buttons and the tab order for the controls are concerned.

However, there is a slight slef-imposed problem (still within the scope of
user interface)! Since I've not yet developed all the algorithms for the
full matrix of option selections, I've to limit my use of the form (for now)
to only certain options from the predefined lists. Let me explain.

Suppose the 1st control frame is named grpA , and has 2 option control
buttons named: opt1 , opt2
The 2nd control frame is named grpB , and has 3 option control buttons
named: opt3 , opt4 , opt5

If opt1 is selected (in grpA) on the form, then opt4 and opt5 (in grpB)
should be disabled.
If opt2 is selected (in grpA), then opt3 (in grpB) should be disabled.

If isn't too much trouble, could you please show me how to encode the above
conditions using the option button names, and where to place these
conditions. In the UserForm_Click () event ??

Thank you.



"Chip Pearson" wrote:

I should have added that you can press F5 with the form active in
the VBA Editor to run the form.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chip Pearson" wrote in message
...
You design and modify userforms in the VBA editor. You test
them in Excel. Create a simple macro in a standard code module
(not the form's code module) to show the form. Run this macro
to test your form in Excel.

Sub ShowTheForm()
Userform1.Show
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"monir" wrote in message
...
I've created a user form (for the 1st time!) with 4 control
frames and 2
command buttons. Each frame has a number of option buttons.
One option in
each frame is selected as the default option. I've even added
an image to
make the form a bit fancier !!

So far so good. Now, I'm trying to test this user interface
before I add
the functionality to the form.
Trying to click an option button, its control frame and its
group frame
appear !
The user form appears to be stuck in its design mode, despite
the fact that
the design mode (on the Tool bar) is not on.

What did I do wrong ? How to exit this design mode ?

Do I have to add something to the UserForm_Click () event, at
this early
stage, to run / test the form ?

Thank you kindly.






--

Dave Peterson