cewiethemaster
Goto Top

Visual C - Formgröße an Bild anpassen

Formgröße in Visual C# 2010 an Bild anpassen

Hallo.

Ich habe eine Form in V C# 2010 (Form1), ein PictureBox element, und ein FileOpenDialog-element.
Der Dialog öffnet eine File, diese wir im Picture geladen.
jetzt will ich die Form an die größe des Bildes anpassen.
Wenn kein bild geladen ist, soll sie 550;350 sein.

Wie kann ich das realisieren?

Content-Key: 156029

Url: https://administrator.de/contentid/156029

Printed on: April 20, 2024 at 01:04 o'clock

Member: SlainteMhath
SlainteMhath Nov 30, 2010 at 13:16:36 (UTC)
Goto Top
Moin,

wie wär's mit

Form1.width=PictureBox.Width
Form1.heigth=PictureBox.heigth

nachdem das Bild in die Picturebox geladen wurde?

lg,
Slainte