J
Jemar Canty
Guest
Hello. I'm new to C++ and trying to write a simple program but keep getting this error : error C2447: missing function header (old-style formal list?). can anyone explain why??
{
public class Form1 : Form
public Form1 ()
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub STPbtn_Click(sender As Object, e As EventArgs) Handles STPbtn.Click
Timer1.Stop()
End Sub
Private Sub SSChk_Tick(sender As Object, e As EventArgs) Handles SSChk.Tick
If (GetAsyncKeyState(117)) Then
Timer1.Start()
End If
If (GetAsyncKeyState(118)) Then
Timer1.Stop()
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y),
New Drawing.Point(0, 0), BMP.Size)
Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0)
CPpanel.BackColor = Pixel
Redtxt.Text = Pixel.R
Greentxt.Text = Pixel.G
Bluetxt.Text = Pixel.B
TextBox1.Text = Pixel.ToString
End Sub
Private Sub CPpanel_Paint(sender As Object, e As PaintEventArgs) Handles CPpanel.Paint
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = OpenFileDialog1.FileName
PictureBox1.ImageLocation = TextBox1.Text
End If
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Process.Start("Google" & TextBox1.Text)
End Sub
Private Sub CPpanel_Paint(sender As Object, Optional p2 As Object = Nothing, Optional e As EventArgs = Nothing)
Throw New NotImplementedException
End Sub
Private Sub STbnt_Click(sender As Object, e As EventArgs) Handles STbnt.Click
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Bluetxt_TextChanged(sender As Object, e As EventArgs) Handles Bluetxt.TextChanged
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
End Class};
}
Continue reading...
{
public class Form1 : Form
public Form1 ()
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub STPbtn_Click(sender As Object, e As EventArgs) Handles STPbtn.Click
Timer1.Stop()
End Sub
Private Sub SSChk_Tick(sender As Object, e As EventArgs) Handles SSChk.Tick
If (GetAsyncKeyState(117)) Then
Timer1.Start()
End If
If (GetAsyncKeyState(118)) Then
Timer1.Stop()
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y),
New Drawing.Point(0, 0), BMP.Size)
Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0)
CPpanel.BackColor = Pixel
Redtxt.Text = Pixel.R
Greentxt.Text = Pixel.G
Bluetxt.Text = Pixel.B
TextBox1.Text = Pixel.ToString
End Sub
Private Sub CPpanel_Paint(sender As Object, e As PaintEventArgs) Handles CPpanel.Paint
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = OpenFileDialog1.FileName
PictureBox1.ImageLocation = TextBox1.Text
End If
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Process.Start("Google" & TextBox1.Text)
End Sub
Private Sub CPpanel_Paint(sender As Object, Optional p2 As Object = Nothing, Optional e As EventArgs = Nothing)
Throw New NotImplementedException
End Sub
Private Sub STbnt_Click(sender As Object, e As EventArgs) Handles STbnt.Click
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Bluetxt_TextChanged(sender As Object, e As EventArgs) Handles Bluetxt.TextChanged
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
End Class};
}
Continue reading...