Autor Beitrag
blutengel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 13:32 
Hi!

Ist es möglich ein Bild an die Größe der Picturebox anzupassen? Habe ein Bild das grösser ist als die Box, und das Problem ist das ich die Picturebox nicht grösser machen kann. Wäre nett wenn mir da jemand helfen könnte.

MFG

blutengel
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Do 16.12.10 13:58 
blutengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 14:20 
Danke das funktioniert schon mal, aber nur wenn ich aud das Pic drauf klicke. Was muss ich machen damit es automatisch geht?

MFG

blutengel
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Do 16.12.10 14:24 
Das sollte eigentlich schon automatisch gehen.
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4803
Erhaltene Danke: 1060

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Do 16.12.10 15:09 
Hallo blutengel,

hast du die Änderung im Designer vorgenommen oder im Source-Code (und wenn dann wo genau - im Konstruktor deiner Form)?
blutengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 15:41 
Habe es in die Methode der Picturebox geschrieben.
Welches ist denn der Konstruktor. Ist doch die Methode die den gleichen namen wie die Klasse hat oder n icht? Also in diesem fall:
ausblenden C#-Quelltext
1:
2:
3:
public form1()
{
}


MFG

blutengel
blutengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 16:15 
Ja klar ist er das: Sorry! Aber wie schauts mit einem Dekonstruktor aus? ist das nicht einfach

ausblenden C#-Quelltext
1:
2:
3:
~form1()
{
}


so kenne ich das auf jeden Fall von Konsolenanwendungen. Geht das hier auch so odder anders?

MFG

blutengel
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Do 16.12.10 16:22 
Ja ist er und kann man bei jeder Klasse verwenden. Hat aber nichts mit deinem Problemchen zu tun und brauchen solltest du den eigentlich sonst auch nie.
blutengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 16:26 
Ich habe das wegen der Picturebox jetzt im Konstruktor stehen und jetzt gehts automatisch
Ist das jetzt die richtige Methode oder gehts noch anders?

MFG

blutengel
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Do 16.12.10 16:28 
Einfach in Designer die Property an der Picturebox passend setzen.
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Do 16.12.10 16:53 
user profile iconblutengel hat folgendes geschrieben Zum zitierten Posting springen:
Habe es in die Methode der Picturebox geschrieben.

Vorsicht. Was verstehst du unter der Methode der PictureBox? Ich nehme an, du hast darauf doppelgeklickt und den Code dort eingefügt. Wenn du dir anschaust, wie die Methode heißt, die dabei erstellst wirst, wird einiges klarer: Sie nennt sich pictureBox1_Click und wird beim Daraufklicken ausgeführt. Ist also alles korrekt ausgeführt worden, so wie du es diktiert hast ;)
blutengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Win XP, WIN 7
VS#2008 Prof
BeitragVerfasst: Do 16.12.10 17:10 
Stimmt du hast Recht. Da habe ich nicht drauf geachtet. Komme sowieso noch nicht ganz so mit diesen ganzen Events klar, aber das kommt noch.

mfg

blutengel