Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load demarage() End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub demarage() Dim g As Graphics Dim GrayBrush As New SolidBrush(Color.Gray) decalage_x = 20 decalage_y = 20 g = Me.PictureBox1.CreateGraphics g.FillRectangle(GrayBrush, 0, 0, decalage_x, Me.PictureBox1.Height) g.DrawLine(Pens.Black, decalage_x - 10, decalage_y, Me.PictureBox1.Width, decalage_y) g.DrawLine(Pens.Black, decalage_x, decalage_y - 10, decalage_x, Me.PictureBox1.Height) End Sub 'procedure de demarage => creation de l'image de fonds
g = Me.PictureBox1.CreateGraphics
Dim maForme As Form1 Load maForme ' Form_Load s'exécute ' Maintenant, je peux toucher aux objets Call Demarrage() maForme.Show ' Affichage
Dim BG As New Bitmap(300, 400) Dim G As Graphics = Graphics.FromImage(BG) G.FillRectangle(Brushes.AntiqueWhite, New Rectangle(0, 0, 300, 400)) Me.BackgroundImage = BG
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(Brushes.AntiqueWhite, New Rectangle(0, 0, 300, 400)) End Sub