Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a Dynamic listbox that I am creating, it's going to be a sort of popup list that you can select from and filters as you're typing. It all works pretty well, except that it's always in the back and a .BringtoFront doesn't seem to do ANYTHING.

 

Anyone have a clue what I'm doing wrong?

 

       'add the dropdown list
       lstDropDown = New ListBox
       With lstDropDown
           .Top = txtDisplayTextBox.Top + txtDisplayTextBox.Height
           .Left = txtDisplayTextBox.Left
           .Height = 95
           .Width = txtDisplayTextBox.Width
           .Visible = True
           .BringToFront()
       End With
       frmParent.Controls.Add(lstDropDown)

Posted

I don't know why it won't come to the front...

 

But I do have one alternative suggestion I got from looking at the C# Express 2005 Beta IDE (they have a small graphical bug where the intellisence popup is in a form with no title or control box so it�s just the form and resizing handles with a list-box set to fill the form)

 

But the list-box looks like it is set to the full height of the form because it�s missing the 4 pixels not accounted for by the resizing handles on the borders.

 

Anyway you could try putting your list-box in a form with no title or control box.

That way you could give it the ability to be resized too and you should have no trouble bringing it to the front.

 

P.S. Sorry if that�s not what you meant.

 

The Red Duke

Posted

One suggestion I can make. I've used (in C# but that shouldnt matter) the BringToFront method and it did work, but I added the control to the forms collection of controls before calling BringToFront. So maybe you can change that..

 

Would be something like this:

...... bit of code i didnt bother with copying ;).
 .Width = txtDisplayTextBox.Width
 .Visible = True
End With
frmParent.Controls.Add(lstDropDown)
lstDropDown.BringToFront()

Nothing is as illusive as 'the last bug'.
  • Leaders
Posted
Yeah, you do need to add it to the control collection before bringing it in front. Otherwise it does not have a collection of controls that it can be brought in front of.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...