daVinci
daVinci

Reputation: 11

how to: make a panel resize with its form; and attach a console for output

  1. how to make the Panel widget change it's size on Form1_SizeChanged
  2. how to attach a console window in order to see console.writeline messages

Upvotes: 0

Views: 12887

Answers (4)

serhio
serhio

Reputation: 28586

Use Anchor or Dock properties. To see the console window in Visual Studio go to the menu View and there you should check displaying "Output".

Upvotes: 2

Daniel Brückner
Daniel Brückner

Reputation: 59685

  1. To resize a control when the parent control size changed you can use the Control.Anchor property.

  2. To get a console window for a WinForms application just go to Project Properties and change Output type in the Application tab from Windows Application to Console Application.

Upvotes: 3

Tim Robinson
Tim Robinson

Reputation: 54764

  1. Take a look at the Anchor and Dock properties on the panel. These let the panel change its size along with the form; you won't need to write any code.
  2. It's a little tricky to attach a console to a running app. If you're just interested in seeing debug messages, look at the Visual Studio output window, or call Debug.WriteLine instead.

Upvotes: 5

Kate Gregory
Kate Gregory

Reputation: 18964

Easiest way to get your Panel to resize is to Anchor or Dock it into the form. Play with the properties pane a bit and you should see how it works.

Upvotes: 2

Related Questions