Click here to Skip to main content
15,892,161 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Web interface to access application Pin
waner michaud26-Feb-13 3:13
waner michaud26-Feb-13 3:13 
QuestionRe: Web interface to access application Pin
Sandeep Mewara26-Feb-13 3:16
mveSandeep Mewara26-Feb-13 3:16 
AnswerRe: Web interface to access application Pin
waner michaud26-Feb-13 3:19
waner michaud26-Feb-13 3:19 
AnswerRe: Web interface to access application Pin
waner michaud26-Feb-13 5:40
waner michaud26-Feb-13 5:40 
GeneralRe: Web interface to access application Pin
Sandeep Mewara26-Feb-13 5:52
mveSandeep Mewara26-Feb-13 5:52 
GeneralRe: Web interface to access application Pin
waner michaud26-Feb-13 6:54
waner michaud26-Feb-13 6:54 
AnswerRe: Web interface to access application Pin
Eddy Vluggen26-Feb-13 9:25
professionalEddy Vluggen26-Feb-13 9:25 
QuestionListbox String to RichTextbox. Help Please! Pin
Gray_Ang3l22-Feb-13 17:14
Gray_Ang3l22-Feb-13 17: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!


VB
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! Pin
Richard MacCutchan22-Feb-13 23:21
mveRichard MacCutchan22-Feb-13 23:21 
AnswerRe: Listbox String to RichTextbox. Help Please! Pin
Flintstone-Fred24-Feb-13 13:24
Flintstone-Fred24-Feb-13 13:24 
GeneralRe: Listbox String to RichTextbox. Help Please! Pin
Gray_Ang3l24-Feb-13 13:29
Gray_Ang3l24-Feb-13 13:29 
QuestionMessage Removed Pin
22-Feb-13 11:13
DougsSoftware22-Feb-13 11:13 
QuestionActive Directory Users OU Pin
dsj4122-Feb-13 8:14
dsj4122-Feb-13 8:14 
AnswerRe: Active Directory Users OU Pin
Dave Kreskowiak22-Feb-13 8:45
mveDave Kreskowiak22-Feb-13 8:45 
GeneralRe: Active Directory Users OU Pin
dsj4124-Feb-13 11:20
dsj4124-Feb-13 11:20 
GeneralRe: Active Directory Users OU Pin
Dave Kreskowiak25-Feb-13 10:31
mveDave Kreskowiak25-Feb-13 10:31 
GeneralRe: Active Directory Users OU Pin
dsj4126-Feb-13 0:14
dsj4126-Feb-13 0:14 
GeneralRe: Active Directory Users OU Pin
dsj415-Mar-13 1:43
dsj415-Mar-13 1:43 
QuestionVolume Button in Text to Speech Convertor Pin
sanju_na21-Feb-13 22:05
sanju_na21-Feb-13 22:05 
QuestionHttpwebrequest + Socks5 Pin
mathisderaltefuchs20-Feb-13 21:49
mathisderaltefuchs20-Feb-13 21:49 
AnswerRe: Httpwebrequest + Socks5 Pin
Richard MacCutchan20-Feb-13 23:00
mveRichard MacCutchan20-Feb-13 23:00 
QuestionHow can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? Pin
Paramu197320-Feb-13 6:19
Paramu197320-Feb-13 6:19 
AnswerRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? Pin
Eddy Vluggen20-Feb-13 6:39
professionalEddy Vluggen20-Feb-13 6:39 
GeneralRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? Pin
Paramu197320-Feb-13 18:50
Paramu197320-Feb-13 18:50 
GeneralRe: How can we read lengthy datas in Win Forms - more height than 780 in single page by scroll? Pin
Eddy Vluggen21-Feb-13 7:03
professionalEddy Vluggen21-Feb-13 7:03 

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

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