0

This is in VB.NET 2003

I have a Form with a few GroupBoxes overlaying one another and being shown based on what the form's supposed to be showing at the moment.

What I want is to have a text object (label, textbox, whatever) be shown regardless of which GroupBox is visible at the moment. Labels that are not inside the GroupBox itself show up under it and are not visible (bringing to front doesn't help), similar issues with TextBoxes, Panels.. I don't know what else to use.

Am I missing something, is there another way of showing text that overlays GroupBoxes without being in them?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Val Schuman
  • 1,798
  • 2
  • 18
  • 23

2 Answers2

0

You can always draw on the form, and specify the coordinates. However this is not done by the label but by GDI+ I believe:

 Dim g As Graphics
 g = CreateGraphics()
 g.DrawString("My text", font, Brushes.White, 100, 30)
 g.Dispose()
apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69
0

You can do this if you make sure your 'text objects' are not contained in any of your GroupBoxes but are still positioned above them so it looks like they are.

There are a couple ways to do this. You can position your objects outside all GroupBoxes, select them and use the arrow keys to move them over your GroupBoxes.

You can also manually set the Location properties of your objects so they end up over the GroupBoxes.

Regardless of how you do this however, make sure you 'Bring to Front' your text objects so they always appear above the GroupBoxes.

Jay Riggs
  • 53,046
  • 9
  • 139
  • 151