Re: Strange z-order behavior

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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" <pproost@xxxxxxxxxxxxxxxxxx> schreef in bericht
news:#i1hrVWVFHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
> 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
>
>


.



Relevant Pages

  • Strange z-order behavior
    ... 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. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: updating usercontrol textbox.text programmatically from host p
    ... Dim myUC As New UserControl ... Dim myTB As New TextBox ... There is an easier way to read and write to the UserControl TextBox ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Creating a simple UserControl from a TextBox
    ... Assume I want to create a very simple UserControl that has the following ... I have a TextBox which should be turned red as soon as you enter a figure. ... public partial class UserControl1: UserControl ... You may also want to make the class a bit more reusable by allowing the client to set the colors that will be used for text with digits versus text without. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Add Label everytime I add a textbox
    ... After adding the textbox and label controls on the ... usercontrol, we can expose them at UserControl level like this: ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: key to parent
    ... behavior in a textbox which is embeded in a usercontrol. ... Actually, there is an AcceptsReturn property in TextBox control, which ... expose an AcceptsReturn property for the user of ...
    (microsoft.public.dotnet.framework.windowsforms)