Click here to Skip to main content

Visual Basic

 
GeneralRe: Identifying the end of an event? Pinmemberjonatasbm26-Feb-13 8:42 
GeneralRe: Identifying the end of an event? PinmvpDave Kreskowiak26-Feb-13 10:08 
GeneralRe: Identifying the end of an event? Pinmemberjonatasbm27-Feb-13 1:10 
GeneralRe: Identifying the end of an event? PinmvpDave Kreskowiak27-Feb-13 2:18 
QuestionWeb interface to access application Pinmemberwaner michaud25-Feb-13 8:16 
AnswerRe: Web interface to access application PinmvpSandeep Mewara25-Feb-13 19:08 
GeneralRe: Web interface to access application Pinmemberwaner michaud26-Feb-13 4:13 
QuestionRe: Web interface to access application PinmvpSandeep Mewara26-Feb-13 4:16 
AnswerRe: Web interface to access application Pinmemberwaner michaud26-Feb-13 4:19 
AnswerRe: Web interface to access application Pinmemberwaner michaud26-Feb-13 6:40 
GeneralRe: Web interface to access application PinmvpSandeep Mewara26-Feb-13 6:52 
GeneralRe: Web interface to access application Pinmemberwaner michaud26-Feb-13 7:54 
AnswerRe: Web interface to access application PinmvpEddy Vluggen26-Feb-13 10:25 
QuestionListbox String to RichTextbox. Help Please! PinmemberJanko199322-Feb-13 18:14 
I am Creating a Client that uses email to send and recieve text messages. I only have to problems when i recieve the mail from the server it goes into my listbox but how do i make that listbox string, when selected, open the body of the message in a richtextbox. Here is my code so far.
 
Also here is a picture of the GUI so you can see the problem a little more clearly.
Click Here For GUI Picture
 
The messages are put into the Inbox i just cant display the body of the message in the richtext box when selected from the listbox. Any Help will be greatly appreciated! Thanks!  

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        'variable declaration
        Dim strMailServer, strUsername, strPassword, strFrom, strSubject, strToo, strBody, strMailContent As String
        Dim popConn As Text_Me_Now.POP3
        Dim mailMess As Text_Me_Now.EmailMessage
        Dim intMessCnt, i As Integer
 
        'set the variables to the input boxes
        strMailServer = "pop.gmx.com"
        strUsername = "xxxxxxx@gmx.com"
        strPassword = "xxxxxxx"
 

 
        'Disable the button when proccessing
        Button2.Enabled = False
 
        'create the objects
        popConn = New Text_Me_Now.POP3
        mailMess = New Text_Me_Now.EmailMessage
 
        'if we have got to this point, try and connect to the server
        popConn.POPConnect(strMailServer, strUsername, strPassword)
 
        'now we have a connection, see if there are any mails on the server
        intMessCnt = popConn.GetMailStat()
 
        'now, see if we have returned any messages
        If intMessCnt > 0 Then
 
            'clear contents of the list and add the heading
            ListBox1.Items.Clear()
 
            'if we returned some messages, loop through each one and get the details
            For i = 1 To intMessCnt
 
                'load the entire content of the mail into a string
                strMailContent = popConn.GetMailMessage(i)
 
                'call the functions to get the various parts out of the email
                strFrom = mailMess.ParseEmail(strMailContent, "From:")
                strSubject = mailMess.ParseEmail(strMailContent, "Subject:")
                strToo = mailMess.ParseEmail(strMailContent, "To:")
                strBody = mailMess.ParseBody()
 
                'add email details to the list box
                ListBox1.Items.Add(strFrom & ", " & strSubject)
 
                'un-comment to display full details of the email in a message box
                'MsgBox("From: " & strFrom & vbNewLine & "Too: " & strToo & vbNewLine & "Subject: " & strSubject & _
                'vbNewLine & "Body: " & strBody)

                'call close method to delete the emails.
            Next i
        End If
        'Quit the connection to the server
        popConn.CloseConn()
 
        Button2.Enabled = True
 
    End Sub
 
    Private Sub ListBox1_SelectedIndexChanged(sender As Object, 
    End Sub

AnswerRe: Listbox String to RichTextbox. Help Please! PinmvpRichard MacCutchan23-Feb-13 0:21 
AnswerRe: Listbox String to RichTextbox. Help Please! PinmemberTnTinMN24-Feb-13 14:24 
GeneralRe: Listbox String to RichTextbox. Help Please! PinmemberGray_Ang3l24-Feb-13 14:29 
QuestionActive Directory Users OU Pinmemberdsj4122-Feb-13 9:14 
AnswerRe: Active Directory Users OU PinmvpDave Kreskowiak22-Feb-13 9:45 
GeneralRe: Active Directory Users OU Pinmemberdsj4124-Feb-13 12:20 
GeneralRe: Active Directory Users OU PinmvpDave Kreskowiak25-Feb-13 11:31 
GeneralRe: Active Directory Users OU Pinmemberdsj4126-Feb-13 1:14 
GeneralRe: Active Directory Users OU Pinmemberdsj415-Mar-13 2:43 
QuestionVolume Button in Text to Speech Convertor Pinmembersanju_na21-Feb-13 23:05 
QuestionHttpwebrequest + Socks5 Pinmembermathisderaltefuchs20-Feb-13 22:49 
AnswerRe: Httpwebrequest + Socks5 PinmvpRichard MacCutchan21-Feb-13 0:00 
QuestionHow can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? PinmemberParamu197320-Feb-13 7:19 
AnswerRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? PinmvpEddy Vluggen20-Feb-13 7:39 
GeneralRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? PinmemberParamu197320-Feb-13 19:50 
GeneralRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? PinmvpEddy Vluggen21-Feb-13 8:03 
QuestionMaximize MDIParent and MDIChild control Pinmemberkurja-kurdoh19-Feb-13 7:41 
AnswerRe: Maximize MDIParent and MDIChild control PinmemberSimon_Whale19-Feb-13 22:58 
QuestionDisable local accounts Pinmemberdouglas.s.johnson@l-3com.com19-Feb-13 6:57 
AnswerRe: Disable local accounts PinmvpEddy Vluggen20-Feb-13 1:32 
GeneralRe: Disable local accounts Pinmemberdsj4120-Feb-13 12:22 
QuestionMenuId saved in Mysql DB and how to set Enable Pinmemberpalur198118-Feb-13 2:31 
AnswerRe: MenuId saved in Mysql DB and how to set Enable PinmvpEddy Vluggen18-Feb-13 23:31 
QuestionAnyone have a program where I can enter a username and have it provide info from Active Directory? Pinmemberanoble115-Feb-13 6:45 
AnswerRe: Anyone have a program where I can enter a username and have it provide info from Active Directory? PinmvpDave Kreskowiak15-Feb-13 7:40 
AnswerRe: Anyone have a program where I can enter a username and have it provide info from Active Directory? PinmemberSimon_Whale15-Feb-13 15:17 
Questionmathematical expression with custom user input operand separately Pinmemberarave052114-Feb-13 7:12 
AnswerRe: mathematical expression with custom user input operand separately PinmemberJibesh15-Feb-13 8:57 
AnswerRe: mathematical expression with custom user input operand separately PinmvpEddy Vluggen15-Feb-13 11:17 
QuestionZoom in / Zoom Out functions Pinmembersyllar12-Feb-13 22:55 
AnswerRe: Zoom in / Zoom Out functions PinmvpDave Kreskowiak13-Feb-13 3:07 
AnswerRe: Zoom in / Zoom Out functions PinmemberSimon_Whale13-Feb-13 3:23 
QuestionEditing columns in a CSV File PinmemberMike Prophete12-Feb-13 12:29 
AnswerRe: Editing columns in a CSV File PinmvpEddy Vluggen13-Feb-13 10:13 
AnswerRe: Editing columns in a CSV File PinmvpMichael Haephrati מיכאל האפרתי20-Feb-13 4:57 
QuestionHelp required in grid conditon Pinmembersiddisagar12-Feb-13 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 23 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid