Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

I think Panel in VB.NET is basically what PictureBox was in VB6... I mean

who really used them to display pictures? They were used as drawing

surfaces, control containers, and buttons, but rarely was the PictureBox

used over the Image control to display pictures.

 

In VB.NET, the Panel, I believe, is what you use for a control container

and whatnot, while the PictureBox is for displaying images (note the

lack of an Image control). I'm not 100% sure which you should use

for drawing on (when you're not using the form) in the case of a

painting program or whatever, but I would assume the PictureBox.

It probably doesn't matter much though.

Posted

Panels are pretty nifty...

 

Panels can be used to position controls in different grids, that's 1 thing...

 

but what comes in Reallll handy is when you want to use a spliter control...

 

Try this:

* start with a new blank form

* draw a panel with half the height of the form

* set this panel1.dock to "top"

* draw a spliter control on the form right under the panel1

* set the spliter.dock to "top"

* set the spliter to a height of about 6 pixels

* draw another panel, panel2, under the spliter

* set panel2.dock to "fill"

* change the .backcolor of both panels to 2 different colors like yellow and blue

 

Run the form

drag the spliter up and down ;-)

 

Nifty, int'nit?

UCM

>-)

Posted

addition...

 

Forgot to mention....

 

try changing the .visible property of either panel to "false"

 

it will disappear but when it goes back to visible, it's back like normal...

 

Why is this important you ask??

 

try putting controls on the panel, such as a textbox and then set the textbox.dock to "fill", now the textbox is scalable.

 

there's much more to it too

UCM

>-)

  • *Experts*
Posted

Also, a Panel supports automatic scrollbars. Draw a textbox really wide, say 200 pixels. Now draw a Panel, say 100 pixels wide. Drop the textbox into the Panel and turn on the AutoScroll properties. You'll see the Panel control can automatically add scrollbars and make them the right size to fit all your controls.

 

I would not recommend doing this except in rare cases. It's not a very standard look, but can be handy if used properly.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

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...