Strange z-order behavior

P

Peter Proost

Hi group I've got a usercontrol containing a textbox and alongside the
textbox there's a combobox. I draw this control on top of a grid. So when
the user clicks certain columns in the grid the control appears at the right
place. This all works just fine except the z-order, at the beginning my
usercontrol contained 2 comboboxes and the z-order was ok. But as I said
before now it's a textbox and a combobox and since I've changed one of the
combo's to a textbox there are strange things happening. The first time the
control is drawn, everything is fine, when I click a next row in my grid the
textbox in my usercontrol seems to get a sendtoback and the combo stays fine
in front of the grid. If I then give an other app the focus and go back to
my app the textbox is fine again. Now I've tried putting
textbox.bringtofront at all kinds of places, I also changed the order at
which the combo and textbox get added to my usercontrol:
Me.Controls.Add(Me.cboCode)
Me.Controls.Add(Me.txtCode)
I also deleted and readded the textbox
but no effect at all.
I find it very strange because when my usercontrol is drawn on the grid i
can see the gridline is drawn where the textbox should be drawn and it stops
where the combobox begins but there should be no gridline visible at all
where my usercontrol is drawn because it's drawn over the gridline.
Thanks in advance for any hints or tips

Greetz Peter
 
P

Peter Proost

Just to let now I found the answer, I forgot to set myusercontrol.visble =
false at the usercontrol leave event and apparently that was causing it.

Greetz Peter
 

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