"Bring to Front" doesn't seem to be working

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

At runtime, I'm trying to make a text box appear in front of a list box when
a certain condition is met.

But in design mode, when I select the list box and the select the menu
option: "Send to Back", then select my text box and select the menu option
"Bring to Front", the text box remains behind the list box.

What's wrong?
 
If the listbox gets focus, it will come to the front. Could that be what is
happening.
 
Anthony said:
At runtime, I'm trying to make a text box appear in front of a list box when
a certain condition is met.

But in design mode, when I select the list box and the select the menu
option: "Send to Back", then select my text box and select the menu option
"Bring to Front", the text box remains behind the list box.


I think it has something to do with complex controls and the
way Access tries to optimize screen painting. I call it a
bug, but I'm sure there are those that would say it was
designed that way because . . .

If you want to see something really weird, try laying a
subform over part of the list box. Watch what happens when
you hover the mouse over the subform and list box's attached
lables. Be sure to scroll the list box after clicking on
the subform.

For normal controls (text box and combo box), the one in
front is on top until the one in the back gets the focus.
It will return to the back when it loses the focus, just the
way it should.
 
Hmm,,, thank you...

So how do you think I should go about trying to do the following:

I want a Text Box control to appear in front of the list box when the user
double clicks it, and be able to input text into the text box, and after
hitting Enter, that text appears in the list box. The Enter key will
trigger a sub that will requery the list box.

In other words, wherever the user clicks on the list box (it has about 8
rows) , the text box will appear on THAT ROW. (I will programmatically make
it move the appropriate spot.)

So then it will appear to the user as if he is opening that "Cell" of the
list box and editing it, then closing it again (and updating the list) after
hitting enter.

Does this make sense? Could you help me think outside the (list) box?

(ha ha)
 
Anthony said:
So how do you think I should go about trying to do the following:

I want a Text Box control to appear in front of the list box when the user
double clicks it, and be able to input text into the text box, and after
hitting Enter, that text appears in the list box. The Enter key will
trigger a sub that will requery the list box.

In other words, wherever the user clicks on the list box (it has about 8
rows) , the text box will appear on THAT ROW. (I will programmatically make
it move the appropriate spot.)

So then it will appear to the user as if he is opening that "Cell" of the
list box and editing it, then closing it again (and updating the list) after
hitting enter.


It's things like this that make me shy away from list boxes.
In fact, I have never used a list box in a production
application. Instead, I use a continuous subform with the
additional benefits of events, properties, etc. If you
placed your popup text box where you want it in the subform,
all you would need to do is make it Visible.

If you need more vertical space that the subform's detail
section provides, you could try opening another form (in
Dialog mode) with one big text box. Unfortunately,
positioning a popup form is non-trivial. See:
http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/7320b2dc3cccd4ef

OTOH, you could try using another subform (in front on main
form) and make that visible/invisible. If the data subform
is not scrolled, positioning the zoom subform is pretty easy
(except for making sure you don't try to move part of it
outside the main form)

Parent.sfmZoom.Visible = True
Parent.sfmZoom.Top = Parent.sfmData.Top _
+ Me.Section(1).Height + (Me.SelTop - 1) _
* Me.Section(0).Height

Once you start scrolling the data subform, I don't readily
see a way to figure out where the click occurred. Perhaps
you can get something from the GetSB stuff at www.lebans.com
 

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

Back
Top