How to use bring to front and Send to back so the rsult is good

T

Tony Johansson

Hello!

I have two radio buttons which are called Active and Not Active.
In addition I have a button .

Now in some forms I want to show only the two radio buttons and in some
I only want to show the buttons. When I show the button I use the same
place on screen where one of the radiobutton was positioned.

I can fix this by using bring to Front but the appearance on the screen is
not so good because
a radio button and a button doesn't use the same space.

So my question is if it's possible to do something so the result will be
good. In some way make the
size for a button and a radiobutton use the same size.

//Tony
 
J

Jeff Johnson

I have two radio buttons which are called Active and Not Active.
In addition I have a button .

Now in some forms I want to show only the two radio buttons and in some
I only want to show the buttons. When I show the button I use the same
place on screen where one of the radiobutton was positioned.

I can fix this by using bring to Front but the appearance on the screen is
not so good because
a radio button and a button doesn't use the same space.

So my question is if it's possible to do something so the result will be
good. In some way make the
size for a button and a radiobutton use the same size.

Define "good."
 
T

Tony Johansson

Hello!

Good here means that when a control is at front it doen't show anything of
the control under.

//Tony
 
P

Peter Duniho

[...]
So my question is if it's possible to do something so the result will be
good. In some way make the
size for a button and a radiobutton use the same size.

Just position all the controls exactly where you want them in the
Designer, and set the default "not active" control(s) Visible property to
"False". Then in your code, control the visibility of the controls using
the Visible property; "false" to hide, "true" to show.

There should be no reason to have to mess around with z-order or the
control's location at all.

Pete
 
J

Joe Cool

Hello!

Good here means that when a control is at front it doen't show anything of
the control under.

//Tony

"Jeff Johnson" <[email protected]> skrev i meddelandet

Set the visible property of the contorl you do not want seen to false.

Set up your code so that the two controls "flip-flop" their visible
property, when one is visible, the other is not.

I have done this with two group boxes that occupy the same location on
a form and need only one of them visible at a time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top