I have to make a lot of retangular boxes to make my program neat but i'm having a problem of adding boxes. I tried using the draw event in the tab page but everytime i scroll it will draw the lines again and messes up everything. Also when making a line greater that the tab page, autoscroll won't work.

Is there a way to make lines or boxes in design time?

Recommended Answers

All 7 Replies

Hi,

Why do you use thoose boxes for?

they are just for graphics there's no use for them. I have as form and trying to duplicate it a bit

Could you use Panels? If not, try creating your own custom control. You can set its shape with the Region property.

Could you use Panels? If not, try creating your own custom control. You can set its shape with the Region property.

I ending using the panels, had no other choice.

I would use Labels(AutoSize=False, for resizing) instead of Panels. Maybe even a PictureBox.
.The reason for Labels/PictureBoxes, is that a Panel is a container, not just a basic control. I'm personally uncertain if it takes more out of an app. to load/design/draw a Panel, than it would to do the same for a Label/PictureBox, but since the Panel is a more complex control overall, my guesses are that it will use up more resources.

I'd say it depends on how much "design" you're doing. Panels are good for single complex graphics (think background picture) and are generally easier to configure/maintain than labels and pictureboxes.

HOWEVER panels DO incur a performance overhead, and they have the annoyance of grabbing controls for children, whether you want that or not. If you're worried about overhead and/or you have a lot of overlapping controls, go with the Label/Picturebox.

If you're basically painting your UI though, it's time to look at a custom control specifically tailored to your needs, as this will be (significantly) less overhead and you can tweak its features precisely.

As these panels are making rectangular boxes, I will end up putting labels inside of them. Program doesn't seem sluggish with these panels. I'm more worried about another form that contains more than 150 comboboxes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.