another error [nothing to do with basics :P] 12-11-2010, 08:37 PM
#1
Public Class DFP
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Exe files|*.exe|Jpg files|*.jpg|Bat files|*.bat|mp3 files|*.mp3"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IconInjector.Click
Dim sfd As New SaveFileDialog
sfd.Filter = "Exe files|*.exe|Jpg files|*.jpg|Bat files|*.bat|mp3 files|*.mp3"
sfd.ShowDialog()
Dim filesize As Double = Val(NumericUpDown1.Value)
IO.File.Copy(TextBox1.Text, sfd.FileName)
If RadioButton1.Checked Then
filesize = filesize * 1024
ElseIf RadioButton2.Checked Then
filesize = filesize * 1048576
ElseIf RadioButton3.Checked Then
filesize = filesize * 1073741824
ElseIf RadioButton4.Checked Then
filesize = filesize * 1099511627776
End If
Dim filetopump = IO.File.OpenWrite(sfd.FileName)
Dim size = filetopump.Seek(0, IO.SeekOrigin.[End])
While size < filesize
filetopump.WriteByte(0)
size += 1
End While
filetopump.Close()
If cb2.Checked Then IconInjector.InjectIcon(sfd.FileName, iconPath)
MsgBox("Successfully Pumped!")
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles iconPath.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Ico files|*.ico"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb2.CheckedChanged
If cb2.Checked Then
Button3.Enabled = True
Else
Button3.Enabled = False
End If
End Sub
End Class
in the bold line i get this error
Error 1 'InjectIcon' is not a member of 'System.Windows.Forms.Button'.
its nothing to do with basics because i googled it![Tongue Tongue](https://sinister.ly/images/smilies/set/tongue.png)
P.s.
Button 2's name is IconInjector
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Exe files|*.exe|Jpg files|*.jpg|Bat files|*.bat|mp3 files|*.mp3"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IconInjector.Click
Dim sfd As New SaveFileDialog
sfd.Filter = "Exe files|*.exe|Jpg files|*.jpg|Bat files|*.bat|mp3 files|*.mp3"
sfd.ShowDialog()
Dim filesize As Double = Val(NumericUpDown1.Value)
IO.File.Copy(TextBox1.Text, sfd.FileName)
If RadioButton1.Checked Then
filesize = filesize * 1024
ElseIf RadioButton2.Checked Then
filesize = filesize * 1048576
ElseIf RadioButton3.Checked Then
filesize = filesize * 1073741824
ElseIf RadioButton4.Checked Then
filesize = filesize * 1099511627776
End If
Dim filetopump = IO.File.OpenWrite(sfd.FileName)
Dim size = filetopump.Seek(0, IO.SeekOrigin.[End])
While size < filesize
filetopump.WriteByte(0)
size += 1
End While
filetopump.Close()
If cb2.Checked Then IconInjector.InjectIcon(sfd.FileName, iconPath)
MsgBox("Successfully Pumped!")
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles iconPath.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Ico files|*.ico"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb2.CheckedChanged
If cb2.Checked Then
Button3.Enabled = True
Else
Button3.Enabled = False
End If
End Sub
End Class
in the bold line i get this error
Error 1 'InjectIcon' is not a member of 'System.Windows.Forms.Button'.
its nothing to do with basics because i googled it
![Tongue Tongue](https://sinister.ly/images/smilies/set/tongue.png)
P.s.
Button 2's name is IconInjector