MSForms problem...

I want to create a simple Frame with CommandButtons. The problem is that the Frame always appears in front of the Buttons. How can I get it to stay behind like the standard Frame?

Thanks,
Tim
tim8wAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vb_elmarCommented:
In the VB IDE, (when the form is visible) klick on the buttons (while holding Strg down)

2. now press Strg-X

3. click on the Frame

4. now press Strg-V (the buttons are on the Frame now)

When starting the programm, the buttons appear in front of the frame.
0
tim8wAuthor Commented:
vb_elmar ,
That works fine for the standard Frame and CommandButtons, but not for MSForms. I select the MSForms button, cut it, select the MSForms Frame, right click and select paste. It places the button in the upper-right corner of the form, just like if I hadn't selected the Frame at all...

Tim
0
vb_elmarCommented:
..hmmmm
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

2AngelCommented:
Why don't you use: right click the frame and then select "Send To Back"?
0
vb_elmarCommented:
>>>Why don't you use: right click the frame and then select "Send To Back"?
@ 2Angel
"Send To Back" does not work - i checked it. -When starting VB, the frame isn't in the background, no matter what i do.
(the controls are fom --->  Microsoft Forms 2.0 Object Library)

@ tim8w
-Try this (working with that code brings the MSForms-Frame to the background and the 2 buttons to the foreground ) :

'Needs 2 MsForms-CommandButtons and 1 MsForms-Frame
Private Sub Form_Activate()
Frame1.ZOrder (1)
Frame1.TabStop = False
CommandButton1.SetFocus
MsgBox "Please  hit   TAB   now."
End Sub
0
tim8wAuthor Commented:
vb_elmar,

Didn't work. I tried the following:

    OptionButton1.ZOrder fmTop
    OptionButton2.ZOrder fmTop
    OptionButton3.ZOrder fmTop
    Frame1.ZOrder fmBottom
    Frame1.TabStop = False
    OptionButton1.Value = True

Is there any other Component combination that will give me transparent backgrounds for OptionButtons AND Frames?

Thanks,
Tim
0
vb_elmarCommented:
tim8w,

Only when VB is running, and Form1_Activate and "Doevents" is done,
the MSForms controls accept  
commands like ZOrder(0) or ZOrder (1).

The constants "fmTop" and "fmBottom" are unknown to VB. -Therefore
VB has to learn the 2 constants first (VB6).

-The sample below will send the frame to back and
bring the three option buttons to top.

Private Sub Form_Activate()
Me.Move 0, 0
Me.BackColor = vbBlue
Frame1.BackColor = vbGreen
DoEvents

Dim fmBottom As Integer, fmTop As Integer
fmTop = 0: fmBottom = 1

MsgBox "Hit me ."
OptionButton1.ZOrder fmTop
MsgBox "Hit me ."
OptionButton2.ZOrder fmTop
MsgBox "Hit me ."
OptionButton3.ZOrder fmTop

Frame1.ZOrder fmBottom
Frame1.TabStop = False
Frame1.Enabled = False
MsgBox "Hit me ."
OptionButton1.Value = True
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.