Results 1 to 10 of 10

Thread: [RESOLVED] 2 questions

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    35

    Resolved [RESOLVED] 2 questions

    Hello again

    This time my mind want to create a picture browser
    i have written this code

    cdl.Filter = "Picture Files(*.Jpg,*.Gif,*.Bitmap)|*.Jpg;*.Gif;*.Bitmap"
    cdl.DialogTitle = "Open File"
    Form1.Picture1.Picture = (cdl.FileName)
    and it is not working
    what does it need ?

    Let's go to the next question
    when i write code like this
    IF A=Tom then
    MsgBox"dfsdf"
    END IF
    IF A= Jerry then
    MsgBox"DSFdsf"
    end if
    when i write Jerry it doesn't working
    what is the couse of the problem ?

    Thanx in advance
    The worst programmer ever

  2. #2
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    Re: 2 questions

    in your first example your missing the
    cdl.open to show the dialog box
    and try this for your second question

    IF A=Tom then
    MsgBox"dfsdf"
    elseIF A= Jerry then
    MsgBox"DSFdsf"
    end if
    now a question to you: are jerry and tom varables?

  3. #3

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    35

    Re: 2 questions

    First i forgot it but i wrote it and nothing happedn there is something to do with filename because it tells Type mismatch
    For your question no i put random names
    but i 'll be pleased if you answer to my question
    ok ?
    The worst programmer ever

  4. #4
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: 2 questions

    If Jerry and Tom aren't variables then they require inverted commas around them, ie:
    VB Code:
    1. IF A="Tom" then
    2. MsgBox"dfsdf"
    3. END IF
    4. IF A= "Jerry" then
    5. MsgBox"DSFdsf"
    6. end if
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  5. #5
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: 2 questions

    you can also use a Select Case construct to make it easier to follow:
    VB Code:
    1. Select Case A
    2.     Case "Tom"
    3.         MsgBox "dfsdf"
    4.     Case "Jerry"
    5.         MsgBox "sdfadf"
    6. End Select

  6. #6

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    35

    Re: 2 questions

    Danke
    Thanx
    Ευχάριστω

    This is the only languages to tell thanx
    The worst programmer ever

  7. #7
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: 2 questions

    If your problem is solved then please click 'Thread Tools' > 'Mark Thread Resolved'
    Thanks!
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  8. #8

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    35

    Re: 2 questions

    the 1 question is ok the other one still remains
    The worst programmer ever

  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: 2 questions

    you need to call .ShowOpen to show the dialog box:
    VB Code:
    1. cdl.Filter = "Picture Files(*.Jpg,*.Gif,*.Bitmap)|*.Jpg;*.Gif;*.Bitmap"
    2. cdl.DialogTitle = "Open File"
    3. cdl.ShowOpen
    4. Form1.Picture1.Picture = LoadPicture(cdl.FileName)

  10. #10

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    35

    Re: 2 questions

    thanxs
    i am going to set it to solved now
    The worst programmer ever

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