CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: VB Frequently asked questions (50 and counting)

  1. #1
    Join Date
    Jan 2000
    Olen, Belgium

    Post VB Frequently asked questions (50 and counting)

    Below is a list of question that are beeing asked over and over again.
    With the question, we also give you the answer, or a link to an already existing post in this board.

    With this we (VB Moderators) hope to reduce the amount of obsolete posts made in this forum.

    This list is probably far from complete. If you want us to add a question to the list, or if you think there's a wrong answer, please contact one of the moderators (Cakkie or Cimperiali).

    Honored contributors:
    M Owen
    + all the authors of the posts of course
    Last edited by Cakkie; April 25th, 2003 at 08:42 AM.

  2. #2
    Join Date
    Jan 2000
    Olen, Belgium
    Q) Do I need ServicePacks?
    Yes. Of everything...
    but beware: newest might be dangeorus in first month
    An issue with Xp sp 2
    positive experiences:
    Example 1 : Vb
    Example 2 : Vb
    Example 3 : Deployment Wizard
    Example 4 : Office
    [do you need more?]

    Where to find Sp6 for visual studio

    Q) How can I search the forum?
    A) Ok, I added this myself:

    Q) How many variables, forms, controls may use?

    Q) How do I open a webpage in the default browser?
    Q) How do I open a new email message with a specified address?
    Q) How do I open a file with it's assiciated program?

    A) Using ShellExecute

    Q) How do I send an email from VB?
    A1) Using Outlook or MAPI or Cdo or Winsock
    A2)Some more options
    A3)Outlook Express

    Q) How do I send a Fax from VB?

    How to get HTML from WebBrowser ?
    in the WebBrowser control

    Q) How do I create, list, or retrieve file asssociations in Vb?

    Q) Does VB support multi-threading?
    No, but this could be usefull anyway:

    Q) Where can I find a VB5/6 decompiler?
    A) Nowhere. There's no such thing as a VB5/6 decompiler.
    There are some programs that allow you retrieve properties
    of forms (like captions etc), but you can't get back the code.

    Q) How do I open a password protected database using ADO?
    A) http://www.codeguru.com/forum/showth...threadid=27393

    Q) How can I get the command line parameters passed to my VB program?
    A) http://www.codeguru.com/vb/articles/1755.shtml

    Q) How can I let the user select a folder?
    A) http://www.codeguru.com/forum/showth...hreadid=209798

    Q) How can I save/get a picture in a database?
    A) http://www.codeguru.com/forum/showth...hreadid=197304

    Q) How to capture screen?
    A2)A working example saving bmp screenshots every 5 minutes
    A3)Another one that draw also the mouse cursor position

    Q) How can I download a file from the internet?
    A) http://www.codeguru.com/forum/showth...hreadid=220177

    Q) How can I call a function in a C++ dll from VB?
    A) http://www.codeguru.com/forum/showth...threadid=29471

    Q) How can I position a messagebox/inputbox?
    A1) http://www.codeguru.com/forum/showth...threadid=20567

    Q) How to read the content of a file in one time?
    A) http://www.codeguru.com/forum/showth...hreadid=220439

    Q) How to write to a file ?
    A1)sequential, random, binary example
    A2)FileSystemObject example

    Q) Any trick to seek in a file ?
    a great Chris Eastwood can teach one

    Q) How can I get information on the tables/queries in a database
    A)You can use ADOX

    Q) How do I use Crystal reports?
    A)There's now a forum dedicated to Crystal Report

    Q) Where can I find other VB resources, like examples and stuff
    A) http://www.codeguru.com/forum/showth...&postid=568385

    Q) How can I get the name of the computer?
    A) http://www.codeguru.com/forum/showth...hreadid=220717

    Q) How can I get the currently logged on user?
    A) http://www.codeguru.com/forum/showth...hreadid=200297

    Q1) How to run statements in a string?
    A)Use the scriptcontrol

    Q2)How to load or show forms having only form name:
    Look for Bruno answers here

    Q3)How to Use CallByName ?


    Q) How can I evaluate an expression in a string.
    A)Use the scriptcontrol

    Q) What to do with single quotes ( ' ) in SQL Statements?
    A) http://www.codeguru.com/forum/showth...hreadid=204669

    Q) How to disable the default popup menu of a textbox?
    A) http://www.codeguru.com/forum/showth...hreadid=216832

    Q) How to manage shortcuts in VB?
    A1)Create shortcut


    A3)Launch shortcut

    A4)Get stored path from shortcut

    A5)Working Dir of shortcut

    A6)Create an Uninstall Shortcut in the StartMenu

    * Continue a bit down     
    Last edited by Cimperiali; December 2nd, 2004 at 11:19 AM.

  3. #3
    Join Date
    Jan 2000
    Olen, Belgium

    Q) Not really a question, but a good link, explains a lot of small nice to know things, very usefull for beginners
    A) http://www.planetsourcecode.com/vb/s...45014&lngWId=1

    Q) Microsoft good links, explains things about Ado, Dao and Rdo

    Q) Sql Server and Access the need of a Primary Key to link access table

    Q) Api-Guide, free examples on Api usage in vb

    Q) Simulate Enter Key on another window
    MKsa answer

    Q) Simulate Mouse click
    A)Shree solution
    B)Covin solution
    C)Iouri solution
    D)Lothar Solution

    Q) Can I divide a CommandButton in regions as per clicking ?
    A)Luthv Tip

    Q) Set Default (System) Printer

    Q) Change Printer Settings

    Q) Dynamically add controls



    Q) Disable X Form Button


    Q) Disable minimize/maximize button of MDIForm

    Q) Icons in menu



    Q) Right justify Help Menu Item

    Q)How to deal with Nt (win2k) eventLog
    1)How to write to nt log
    2)How to read from event log

    Q)How to launch dos commands?

    Q)How to Shell an exe from ASP?

    Q)How to deal with Registry
    1) JeffB suggestment: http://www.codeguru.com/forum/showth...088#post850088

    Q)How to Block a keyboard key even for
    external programs

    (Note: this will NOT disable Ctrl+Alt+Del combination)
    1)works on Win2000:

    Something not all know:
    How to: handle file greater than Two_Gigs in Vb (if Os lets you)

    Something always useful
    How to: Zip and Unzip in Vb
    Last edited by Cimperiali; October 8th, 2004 at 09:57 AM.
    Tom Cannaerts
    email: cakkie@cakkie.be.remove.this.bit
    www.tom.be (dutch site)

  4. #4
    Join Date
    Jul 2000
    Milano, Italy

    ...Continued... More stuff

    Q) HowTo kill a Process

    Q) HowTo discover Cpu/Mem usage

    Q) get Exe name from Form caption

    Q) Advanced PrevInstance using mutex
    hspc solution

    The truth on SSTab Control
    What WizBang TheWizard discovered

    Q) My vb program does not close even if I unloaded the form
    JeffB: Exit process
    or: a cylce to be sure you really unloaded all and some advices more
    and - in any case - avoid "End" (unless on Windows Me)

    Q) Suddenly Right() and Mid() stop working...
    WizBang solution

    Q) Dealing with As400 and waitMsg
    Dmorley Great solution

    Q) Is it possible to Send Ctrl+Alt+Del using code?
    We are still working on that...

    Something more under the Hood?
    Nice article on How Vb stores data

    Q)How to Invert Colors ?
    Vb_The_Best solution
    Last edited by Cimperiali; June 13th, 2005 at 03:54 AM.
    ...at present time, using mainly Net 4.0, Vs 2010

    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Dec 2001

    Re: VB Frequently asked questions (50 and counting)

    Q) How to convert an image to JPEG
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  6. #6
    Join Date
    Jul 2000
    Milano, Italy


    From http://www.codeguru.com/faq.php

    What are the "reputations" in the forums
    The CodeGuru site allows for a number of different ratings. Reputations is one of
    these ratings. Reputations are points gained or lost on individual posts within the
    discussion forums. Because these are tied to individual posts, they reflect back on
    the person who made the post, thus giving them a reputation.

    Your reputation can have positive and negative changes. Better yet, as a member
    of CodeGuru, you can add to others' reputations. If someone gives you a great
    answer, you can give them a positive reputation point(s) as a thanks. If someone
    blasts a thread with an off-topic post or with negative comments, you can give
    them a negative reputation. With time, these reputations will help the "star
    posters" rise and the people who only provide noise to become visible as well. Is
    it possible to cheat the system? Yes, but as it was in the old days, the forum
    moderators and I are aware of many of the ways to cheat the system and will
    take appropriate actions.

    Reputations are indicated by a small graphic. The more positive your reputation,
    the more visible the graphic will become. This will be displayed by all your posts
    and in your profile. To add to someone's reputation, you will click a small scale
    graphic on the upper, right area of the post. It looks like a scale or balance. This
    will result in a pop-up window as shown in Figure 1.

    Figure 1: The Reputations window.

    In this window, you can either give a positive point (approve) or negative
    (disapprove). You should also add a comment on why you approve or disapprove.
    If this is your post, you'll be able to see the reputation points you have by clicking
    on the scale;

    Reputations come with rules. You only get a certain number of points each day, so
    use them only for the best postings and responses. Right now, this is 6 times per
    day that points can be given.

    There is reputation POWER. Power is the number of points you give each time.
    This starts at 1 point, but increases based on a number of criteria such as posts,
    tenure, and your own reputation. When you give negative points, they are at half
    of your power level.

    Here are some other rules and settings for reputations(which are subject to

    You must give reputations to a number of different people before you can
    come back to the same person again. No giving just one person all your points!

    For every 1000 posts at CodeGuru (that are counted—so not including chitchat),
    you get an extra point of reputation POWER.

    For every year you have been with CodeGuru, you get an extra point of repuation

    For every 1000 points of reputation you receive, you get an extra point of
    repuation POWER.

    While you can use reputation points today, your reputations will not be applied
    until the following conditions are met:

    You must have posted at least 25 counted messages to CodeGuru.

    There was a rule that you must have 5 points of reputation yourself before your
    points will count (you start with 5).
    ...at present time, using mainly Net 4.0, Vs 2010

    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Dec 2001

    Re: VB Frequently asked questions (50 and counting)

    Q) How to print directly to a Dot-Matrix printer:
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)