Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to make my menu about button take me to another form. I added the code but it says its a non-shared memeber and requires an object reference? any ideas?

 

Private Sub butSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSend.Click

Dim bSuccess As Boolean = False

Dim oFiles As New Collection()

Dim sFileNames() As String

Dim byArray() As Byte

Dim i As Integer

Dim fs As FileStream

Dim oSMTP As New SMTPMailer.CSMTP()

Dim about As New Form()

 

butSend.Enabled = False

If lstFiles.Items.Count <> 0 Then

ReDim sFileNames(lstFiles.Items.Count - 1)

For i = 0 To lstFiles.Items.Count - 1

sFileNames(i) = Path.GetFileName(lstFiles.Items(i).ToString).ToString

 

fs = New System.IO.FileStream(lstFiles.Items(i).ToString, System.IO.FileMode.Open, System.IO.FileAccess.Read)

ReDim byArray(CInt(fs.Length))

fs.Read(byArray, 0, CInt(fs.Length))

 

oFiles.Add(byArray, sFileNames(i))

Next

bSuccess = oSMTP.Mail(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text, txtServer.Text, oFiles, sFileNames)

Else

bSuccess = oSMTP.Mail(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text, txtServer.Text)

End If

oSMTP = Nothing

fs = Nothing

oFiles = Nothing

butSend.Enabled = True

End Sub

 

Private Sub butBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butBrowse.Click

dlgOpen.ShowDialog()

txtFileName.Text = dlgOpen.FileName

End Sub

 

Private Sub ExitApp()

Dim ChildForm As Form() = Me.MdiChildren

'Make sure to ask for saving the doc before exiting the app

Dim i As Integer

For i = 0 To ChildForm.Length - 1

ChildForm(i).Close()

Next i

Application.Exit()

End Sub 'Exit

 

Private Sub butAddFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butAddFile.Click

lstFiles.Items.Add(txtFileName.Text)

End Sub

 

Private Sub butRemoveFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butRemoveFile.Click

lstFiles.Items.Remove(lstFiles.SelectedItem)

End Sub

 

Private Sub dlgOpen_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles dlgOpen.FileOk

 

End Sub

 

Private Sub about_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

End Sub

 

Private Sub txtServer_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

 

End Sub

 

Private Sub frmMailTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

End Sub

 

Private Sub txtServer_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtServer.SelectedIndexChanged

 

 

End Sub

 

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click

 

End Sub

 

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click

dlgOpen.ShowDialog()

txtFileName.Text = dlgOpen.FileName

End Sub

 

Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles StatusBar1inactive.PanelClick

 

End Sub

 

Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

 

End Sub

 

Private Sub txtBody_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBody.TextChanged

 

End Sub

 

Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click

ExitApp()

End Sub

 

 

 

Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click

Form.Show()

 

End Sub

End Class

"Drink wet cement and get really stoned"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...