My company has a special build we install on machines that need to have a VB app or an app that uses Crystal Reports installed on it. This way, only the application-specific files and reports can be distributed without needing the runtime files packaged along with them. Here is a listing of...
One common trick to extend the amount of time a Timer control can wait is to create a module level variable that acts as a counter, and incrementing it every time the Timer event fires. When the counter reaches a particular value, you can do whatever you need to do.
Try this:
Create a Form...
Kevin,
I forget who said it, but theres a quote "Those that will trade freedom for security will lose both."
To play devil's advocate, has there ever been a case where a freedom was lost, but society was made safer in the exchange?
I haven't been able to think of any.
Steve
You are correct that GetTickCount returns the number of milliseconds since the system was started. There are 1000 milliseconds in a second, so you would want ot replace
secs = GetTickCount()/6000
with
secs = GetTickCount()/1000
Hope this helps.
Steve
Your example is a little vague, but it looks like you have a line with endpoints (x1, y1) and (x0, y0) and you want to rotate it by angle, so that its endpoints are now (newx1, newy1) and (x0, y0).
If this is the case, what you need to do is determine the length of the line using the...
Have you tried this?
Suppose you have labela and labelb that you want to move on a form that is 14000 twips wide (as appears from your example above).
Dim SpeedA as Long
Dim SpeedB as Long
'get a speed for A and B
SpeedA = int(rnd * 12 + 1)
SpeedB = int(rnd * 12 + 1)
Do Until ((labela.Left +...
Hey all,
I am designing a reporting application that pulls data from a SQL 6.5 database and puts it on a VB6 DataReport. One of the features of the report needs to be a list of fields that have not been filled in by the user -- ie, if they haven't filled in the effective date for a...
If you have the server mapped as a drive, then you can just point the VB app to the drive and directory, in the same manner as if the Access database was on the local machine.
Steve
In your function, after you have gotten the file name from the common dialogue, have something like
sNewFile = GetFileName(strFileName) & ".txt"
Or, you could do
Dim strShortFileName as String
strShortFileName = GetFileName(strFileName)
sNewFile = strShortFileName &...
I actually try do this same thing in every program I write -- it makes debugging a snap.
Every module and function I write has a header and footer, like:
Private Const ModuleName = "MyModule"
Public Function MyFunction()
Const ProcName = "MyFunction"
On Error Goto...
When I had to do something similar for a previous project, I set up a loop that started at the back of the filename and moved forward until I found a dot, presuming that everything after the last dot in the filename is the extension. I just took everything in front of this dot as the name of...
Suppose you had a file named CurrFiles.txt that had the contents:
c:\folder\file1.m3u
c:\folder\file2.m3u
c:\folder\file3.m3u
c:\folder\file4.m3u
You could put 2 listboxes on a form, along with a button titled Add File.
You could manipulate the files like:
Private Sub Form_Load()
Dim...
In order to use the FileSystemObject object, you need to reference the Microsoft Scripting Runtime library, Scrrun.dll.
I'm not sure about Access 97 (been a long time since I've used it), but in VB6, this library didn't automatically appear in my list of components in the References window. I...
To use a DLL object from outside the component, all you have to do is set the Instancing property of the classes to a setting other than Private. The other settings give the class various types of behavior, but as long the class isn't Private, it can be accessed from outside the DLL.
In order...
DO you not want to display the DOS window, or not use a DOS/NTVDM process at all?
If you just don't want the DOS window to appear, you could try Shelling the compile process out of the VB app, such as:
Shell "C:\Program files\Vb98\C2.exe <parameters>", vbHide
This will run the...
Paul,
When you make the backup (ie, copy the file to C:\Backups), you would probably want to date stamp it, like Backup20001018, where the date is in yyyymmdd format. This way, the backup filenames can be loaded into the listbox and they can easily be sorted as newest or oldest on top.
To...
If you have an array of 3 textboxes, named Text1 and having indices 1, 2 and 3, you could probably set something up like this:
'30 character max length
Const MAX_LENGTH = 30
Private Sub Text1_Change(Index as Integer)
Dim CurrWord as String
If (Len(Text1(Index).Text) > MAX_LENGTH) then...
Try this:
Dim OldString as String
Dim NewString as String
OldString = "Test1;Test2;Test3"
NewString = Replace(OldString, ";", vbCrLf)
This will replace the semicolon with the carriage return/line feed character.
Steve
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.