having two controls occuping the same place on the form

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

I just wonder what is the point to have two controls that occupy the same
place on the form.
I know you can use this send to back and bring to front but I cant see any
point to use it.

//Tony
 
Hello!

I just wonder what is the point to have two controls that occupy the same
place on the form.
I know you can use this send to back and bring to front but I cant see any
point to use it.

I've used it when I want to get user input for a field and under some
circumstnaces, the user must key in a value (a textbox) or the user
can select from a list (combobox).
 
I use it some with panels that are full of data: Instead of changing all of
the data on the panel, I just send one to the back and display the data on
the other.
 
Tony Johansson said:
Hello!

I just wonder what is the point to have two controls that occupy the same
place on the form.
I know you can use this send to back and bring to front but I cant see any
point to use it.

//Tony


I have a customer who likes the edit modes of a value to vary between a
textbox and a label. One becomes visible as the other becomes invisible,
depending on whether they are in edit mode.
 
I use it some with panels that are full of data: Instead of changing all of
the data on the panel, I just send one to the back and display the data on
the other.

That's how you HAD to do TabControls in VB6.
 
- To simulate a wizard made of a small number of steps (ie, Step1, Step2,
Step3), with different userControl for each step, always at the same
position, while the end user allowed to navigate forward, or backward, or
"finish" the process, from other controls on the form.

- To present different type of data from a super group of data. Example, a
list of bills (database navigation through the bills): while different bills
have data in common for all kind of bill, some details may differ for a bill
about electricity, or for a bill of gas; and having many controls
'unselectable' or 'invisible' accordingly to the exact type is not "as
nice as" a specific ad hoc userControl (always at the same place, on the
form, and 'filling' the space 'nicely', without 'holes' here and there).


In fact, both of these scenarios are directly 'taken' form the 'sub-form'
concept in Access (where you don't really superpose multiple controls, but
have just one where you specify its property "source object" accordingly to
the 'form' to be displayed, at run-time, as the situation requires it).



Vanderghast, Access MVP
 
Hello!

I just wonder what is the point to have two controls that occupy the same
place on the form.
I know you can use this send to back and bring to front but I cant see any
point to use it.

//Tony

Hi,

There are a number of scenarios where this is valid. One example is if
the interface needs to display different controls depending of some
criteria. there are other valid scenarios but IMHO I think the one I
mentioned is the most usual
 
Back
Top