Questions about controls sent to back

M

Michel S.

Hi !

I'm using textbox/combo pairs to display and edit fields (in textbox
got focus event, I set the focus to the combo and in the combo' after
update event, I set the textbox valut to the combo's.).

In design mode, I set the combo to back and the text box to front, in
order to show the textbox upon exiting the field.

Since I use the same combo to edit the values of many fields, I also
change it's coordinates to those of the textbox in it's gotfocus event.

The problem I experience is that when exiting the field, it's the combo
that stays on the screen.

My questions are :

- does changing a control coordinates affect it's front/back settings ?

- if so, can the "send to front/back" setting for a control be set
programmatically ?

- if not, what's wrong with this way of doing things ?

Thanks !
 
M

Michael H

Hi.

Why not set the Visible property of the Combo box to False when you no
longer need to see it on the screen, and back to True when you do?

-Michael
 
M

Michel S.

Thanks for your answer,

Unfortunately, you can't set the active control's "visible" property to
false.

AFAIK, setting the textbox visible property to "true" should do the
thing without having to worry about which control has the focus.

But there's not the case here.

MS


Michael H avait énoncé :
 
M

Michael H

Then, couldn't you just set the focus back to the TextBox first? In fact, if
the controls overlap, setting the focus to the TextBox should bring that one
to the top, and eliminate the need to make the ComboBox invisible.

-Michael
 

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