devxlogo

The Latest

INP/OUT Replacement

Question: I’ve got to control 3 stepper motors from the printer port. How can I activate pins on the printer port using Visual basic. For Example I want to activate

Dialing a Phone

Question: Can you show me how to open COM1: and dial a phone number using tone dialing? Answer: Try this. This is out of the VB Frequently Asked Questions file.PhoneNumber$

Passing Control Arrays to a Function

Question: Is it possible to pass a control array to a function? I have tried for days unsuccessfully, but nowhere in the VB ocumentation can I find that this is

Problems With Single Quotes

Question: Single quotes are messing up my queries. What can I do to fix the following problem?Dim Criteria as StringCriteria=”Name LIKE ‘” & SearchName & “‘” ‘SearchName=”Sam O’Brien”‘At this Point

Passing a Form to a Sub/Function

Question: How do I pass a form as an argument to a function or procedure? I have tried passing the the form name directly and the form name as a

Redirecting DIR Command Output

Question: How do I create the VB equivalent of the command belowDIR C: /S /B >MYFILE.LSTI need this routine for a program that keeps track of installedand removed files. Answer:

Distributing VB400xx.DLL with Applications

Question: I just wrote my first VB4 program, the “Hello World” program out of the SAMS book, “Learn VB4 in 21 Days”. My question is this: I compiled my program

Filling DBGrid Manually

Question: Id like to no how you address text to the DbGrid1 custom control. For example the Grid control addressesby How would I do this with the DbGrid1 custom control

Opening a Topic Through Code

Question: What steps do I take to open/ retrieve a particular help topic (usingContext string/ID) of a Help File? Answer: This code, using the CommonDialog control, could be put behind

Intercepting Windows Messages

Question: I want to add a new item to the control box menu(or system menu). I add a new item using API’s likeAppendMenu and InsertMenu and both work fine, but

Using Ampersands in Labels

Question: I can’t seem to figure out how to place a “&” sign in a text field or in a label’s caption. Answer: Try putting two ampersands next to each

Validating Input Data in LostFocus

Question: I have two fields on the screen that I use to enter a date range. I want to check the entry on the lost focus with IsDate, and in

Simulating Buttons

Question: I would like to make a row (in a frame) of command buttons that could light up when depressed. And also have some small round buttons (like option buttons)

Memory Management: Lost Resources

Question: Each time I run a certain application from VB environment, resources go lower and lower. When I exit VB, all the memory is released.I do not have that problem

Dynamically Creating Controls

Question: I am a teacher (this explains my lack of expertise at understanding many VB technicalitiesin manuals etc.) experimenting with creating bits and pieces of software for children with learning

Executing DOS Commands

Question: How can I run the following “SHELL” command in VB? It works fine in PowerBasic, but VB 3.0 doesn’t like it.SHELL “DIR *.BKP > FILES.LST”Any ideas? Answer: Try this:Shell

Handling Dependent Processes

Question: I need execute some commands to rename/copy files. What is the best method of performing this type of function.I do not want to fire off a batch file, but

Screen Saver Development

Question: What all do I need to know to create a screen saver in Visual Basic? Answer: Windows screensavers are easy and fun to write in Visual Basic, but there

Object Was Unloaded Error

Question: When I try to unload some forms with database controls on them while in the Form_Load event, VB tries to show the form again and issues the statement ‘Object

Grids with Spanning Columns

Question: I need a way to make a grid/table that would support headers and cell data spanning multiple rows as wellas multiple columns. Any ideas? Answer: VideoSoft has a product

Limiting Size of Popup Windows

Question: How do you limit the size of a help file definition window? When I program a pop-up window for a definition, its as big as the main Help window

Accessing a DBGrid Cell

Question: How can get the Text contained in a specified Cell in DBGrid? Answer: If you set the Row and Col properties first, you can then look at the “Text”

Changing Default Title on Window

Question: I made a copy of a project for a new application. The problem is that each time a message box is displayed it has the old project name as

Getting Available Disk Space

Question: I am looking for a way to determine the numberof bytes on a hard drive. Preferable I’d liketo know the total bytes on a drive and the bytes used

Dynamically Positioning Controls at Runtime

Question: It is easy to use control arrays to load controls inside a container. Now the problem is I do not know how many containers e.g., groups of option buttions,

Centering a Form on the Screen

Question: How do I center a form on the monitor regardless of monitor resolution? Answer: The Screen object contains the properties of the current display. In the Form_Load event, you

Right-Justifying Output

Question: My VB program produces as output, paper reports such as Income Statements and Balance Sheets. How do we get the numbers to print as they should, that is, dollars

Getting Started

Question: We have a big complete hospital system written in ClipperWe had looked at VO, but that does not seem to be the way to goWe will now concentrate on

Creating Delays

Question: Can you suggest ways to delay sending keystrokes to the external application? I’ve tried inserting ‘For-Next’ loops of different durations but without success. Answer: Try a timer control. That