How can I set the focus on a window in vbscript

Posted on 2006-05-22
Last Modified: 2006-11-18
In this case I want to set the focus on a messagebox
Question by:itbabe
    LVL 65

    Expert Comment

    something like this perhaps

    this example gives focus to a textbox on a form


    LVL 65

    Expert Comment

    Just a thought, when u use

    MsgBox to bring up a messagebox in vbscript, dont it normally set focus anyway?
    LVL 65

    Expert Comment

    a thought, if u want to force your msgbox to be in the front all the time, how about bringing it up as modal?

    MsgBox "I want to be in the Foreground", vbExclamation + vbSystemModal

    LVL 65

    Accepted Solution


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    EvenOdd challenge 10 68
    wordsWithout 49 64
    bunnyEars challenge 6 45
    python sqlite question 11 24
    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now