Hallo Com,
ich habe gerade einmal mein Projects Ordner von Visual Basic genauer unter die upe genommen und bin dabei auf ein paar Programme gestoßen die ich einmal Programmiert habe.
Ich stelle euch hier nun eines Davo vor es ist ein Paint Programm...
Laden und Speichern könnte ich damals Noch nicht und werde es denke ich auch nicht mehr hinzufügen.
Bild ist auch im Anhang ;)
Hier ist mal der Quellcode
Form1.vb
ich habe gerade einmal mein Projects Ordner von Visual Basic genauer unter die upe genommen und bin dabei auf ein paar Programme gestoßen die ich einmal Programmiert habe.
Ich stelle euch hier nun eines Davo vor es ist ein Paint Programm...
Laden und Speichern könnte ich damals Noch nicht und werde es denke ich auch nicht mehr hinzufügen.
Bild ist auch im Anhang ;)
Hier ist mal der Quellcode
Form1.vb
Code:
Public Class Form1
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim newPictureBox As New PictureBox
newPictureBox.BackColor = PictureBox2.BackColor
newPictureBox.Visible = True
newPictureBox.Top = (TextBox2.Text)
newPictureBox.Width = TextBox3.Text
newPictureBox.Height = TextBox4.Text
newPictureBox.Left = (TextBox1.Text)
'add control to form
Controls.Add(newPictureBox)
newPictureBox.BringToFront()
PictureBox1.SendToBack()
Panel1.BringToFront()
End Sub
Private Sub PictureBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick
Dim newPictureBox As New PictureBox
newPictureBox.BackColor = PictureBox2.BackColor
newPictureBox.Visible = True
newPictureBox.Top = (TextBox2.Text)
newPictureBox.Width = TextBox3.Text
newPictureBox.Height = TextBox4.Text
newPictureBox.Left = (TextBox1.Text)
'add control to form
Controls.Add(newPictureBox)
newPictureBox.BringToFront()
PictureBox1.SendToBack()
Panel1.BringToFront()
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Dim newPictureBox As New PictureBox
newPictureBox.BackColor = PictureBox2.BackColor
newPictureBox.Visible = True
newPictureBox.Top = (TextBox2.Text)
newPictureBox.Width = TextBox3.Text
newPictureBox.Height = TextBox4.Text
newPictureBox.Left = (TextBox1.Text)
'add control to form
Controls.Add(newPictureBox)
newPictureBox.BringToFront()
PictureBox1.SendToBack()
Panel1.BringToFront()
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
Dim y, x As Integer
y = e.Y
x = e.X
Textbox1.text = x
Textbox2.text = y
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox2.BackColor = Button2.BackColor
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PictureBox2.BackColor = Button3.BackColor
End Sub
Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
PictureBox2.BackColor = Button4.BackColor
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
PictureBox2.BackColor = Button5.BackColor
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
PictureBox2.BackColor = Button6.BackColor
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
PictureBox2.BackColor = Button7.BackColor
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
PictureBox2.BackColor = Button8.BackColor
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
PictureBox2.BackColor = Button9.BackColor
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
PictureBox2.BackColor = Button11.BackColor
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
PictureBox2.BackColor = Button12.BackColor
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
PictureBox2.BackColor = Button13.BackColor
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
PictureBox2.BackColor = Button13.BackColor
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
PictureBox2.BackColor = Button15.BackColor
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
PictureBox2.BackColor = Button16.BackColor
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
PictureBox2.BackColor = Button10.BackColor
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
PictureBox2.BackColor = Button17.BackColor
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
PictureBox2.BackColor = Button18.BackColor
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
PictureBox2.BackColor = Button19.BackColor
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
PictureBox2.BackColor = Button20.BackColor
End Sub
Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
PictureBox2.BackColor = Button21.BackColor
End Sub
Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
PictureBox2.BackColor = Button22.BackColor
End Sub
Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedItem = ("Viereck")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
COlordialog1.showdialog()
PictureBox2.BackColor = ColorDialog1.Color
End Sub
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Public Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Public Sub SimulateClick()
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Timer1.Start()
Else
Timer1.Stop()
End If
End Sub
End Class