Results 1 to 8 of 8

Thread: A message popup.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93
    ok, say you make a list box. It will be called list1. I am making a list box. It will have |About| option and a |Help| option in it' I want to know how I can make it is that when you scroll to that one and you double click on it a box will apear and will say |"what you want in the message."|
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    Guest
    Code:
    Private Sub List1_DblClick()
    MsgBox List1.Text
    End Sub
    is this what your talking about ?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    where do you specify...

    where do you specify what one to click on to make the poupup?
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    popup

    'hopefully this will lend you a hand
    'in understanding how it works.

    Option Explicit

    Private Sub Form_Load()

    List1.AddItem "First Entry"
    List1.AddItem "Second Entry"
    List1.AddItem "Third Entry"

    End Sub

    Private Sub List1_DblClick()

    Dim msg, Helper As String

    If List1.ListIndex = 0 Then Helper = 1
    If List1.ListIndex = 1 Then Helper = 2
    If List1.ListIndex = 2 Then Helper = 3

    Select Case Helper
    Case "1"
    msg = "This is the first entry" & vbCrLf
    msg = msg & "So how can I help?" & vbCrLf
    msg = msg & "Maybe this will do!"
    MsgBox msg
    Case "2"
    msg = "This is the second entry" & vbCrLf
    msg = msg & "So what about 1 + 1 = 2" & vbCrLf
    msg = msg & "Could be 2, I think."
    MsgBox msg
    Case "3"
    msg = "This is the third entry" & vbCrLf
    msg = msg & "So what about 3rd place?" & vbCrLf
    msg = msg & "I can't remember who came second!"
    MsgBox msg
    End Select


    End Sub


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Guest
    Code:
    List1.additem "About"
    List1.additem "Help"
    
    If List1 = "About" Then Msgbox "You've just clicked about!  Congradulations!"
    If List1 = "Help" Then Msgbox "Sorry, I can't help you!  Go help yourself!"

  6. #6
    Member bcx7's Avatar
    Join Date
    May 1999
    Location
    Adelaide, South Australia, Australia
    Posts
    46

    another way...

    try this...

    Code:
    private sub form_load()
    
    list1.additem "one"
    list1.additem "two"
    list1.additem "three"
    
    end sub
    
    
    private sub list1_click()
    
    select case list1.ListIndex
    case 0
    msgbox "one message"
    case 1
    msgbox "two message"
    case 2
    msgbox "three message"
    end select
    
    
    end sub
    the first item one the listbox starts at 0. (that's why it's case 0 first)

    just keep adding cases for all the thing you add to the list.

    This is similar to the other persons reply but i eliminated the Helper varible.




    [Edited by bcx7 on 06-18-2000 at 09:23 PM]
    I Use Visual Basic 5.0 Enterprise Edition SP3

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    hey matt gates

    Hey Mattey Gates, your code helped me the mods. It was the easiest too. Can you help me with this one? Say you wanted to make a link on your app like say a link to a site and your e-mail, if needed I was gong to make the link to http://www.vb-world.net and direct the e-mail to [email protected]
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  8. #8
    Guest
    matthews is easier, but what if your list grew to be like 40 or 50 entries long(it probably wont.. but who knows?) mine would be smaller,
    mine is saying

    "when the list is doubleclicked, make a messagebox appear with the text of the selected item"

    simple

    and for the last Q?

    Code:
    Option Explicit
    
    
    Public Const URL = "http://www.vb-world.net"
    Public Const email = "[email protected]"
    
    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Public Const SW_SHOWNORMAL = 1
    
    Public Sub gotoweb()
    Dim Success As Long
    
    Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
    
    End Sub
    
    Public Sub sendemail()
    Dim Success As Long
    
    Success = ShellExecute(0&, vbNullString, "mailto:" & email, vbNullString, "C:\", SW_SHOWNORMAL)
    
    End Sub
    put that into a module.

    and call them from a command button or whatever like this


    Code:
    Private Sub Command1_Click()
    gotoweb
    sendemail
    End Sub

    this is what you wanted... right?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width