By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Strange z-order behavior

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:#i**************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.