Results 1 to 8 of 8

Thread: get msgbox to auto click ok ?

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    get msgbox to auto click ok ?

    My prog works fine if a msgbox is at a certain place in the code. I'm not sure why but if i can get it to auto click ok then im not too bothered at the moment, something like

    msgbox "", vbok = true

    is this possible ? The above code is just a guess at what it would do , i dont know if this is actually ok code.

    thanks.

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    If it'll click OK automatically, why display it at all ?
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Its difficult to explain , a lot of trial and error used to find this out, i think think it acts as a combination of a delay plus user input.

    I use msgboxes positioned at different parts of my code to debug when the code say, compiles ok but gives runtime errors, using msgboxes i can work out which part of the code runs ok, well turned out that if i have a msgbox at a certain part of my code it runs fine, i did origianlly have a sleep(x) call there but this didnt work.

  4. #4
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    Why not use breakpoints instead of message boxes?
    If wishes were fishes we'd all cast nets.

  5. #5
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    If displaying the message box keeps parts of your code running, it's because it's "pausing" the program. Try sticking a doevents in at process intensive parts of your code, I'll bet that will help and you can do away with the message boxes. Making them auto click ok would lessen the "pause" they're causing in your code, so it may not end up working.
    I don't know if you can make them auto click ok anyway though, but if you make your own message box with just a form, you could make that auto click. You should probably avoid that though, doesn't sound like a good work around.

  6. #6
    Hyperactive Member
    Join Date
    Dec 2003
    Posts
    305
    u cud use send key enter :P

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Mr_Zer0
    u cud use send key enter :P
    No you can't, because a message box is shown modally, so no code will execute until you close it.

    I would try to figure out what the true problem is before doing something like this.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Could a timer be implemented into this somehow?

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