The first options that come to me are passing some sort of flag to the Timer sub:
private ResetTimer as Boolean
Timer procedure:
If ResetTimer then
'static variables are zeroed
ResetTimer = False
End If
Another option would be to run your program out of a Sub Main(), and use...
Try adding DoEvents within your major While loops. Depending on how you've designed your program to update the statusbar information, it will help that occur; otherwise, it will definitely keep the program responding as far as Windows is concerned.
Far easier IMO is the Dir$() function:
If LenB(Dir$("C:\yourfile.txt")) = 0 Then
' file does not exist, create it
Else
' file exists
End If
The Dir$() function will return a nullstring if the file does not exist.
http://www.tek-tips.com/viewthread.cfm?SQID=790750&SPID=222&page=1
Read my comment here.
Additionally: Try the Microsoft Visual Basic 6 Runtimes. You can find them here: http://support.microsoft.com/default.aspx?scid=kb;en-us;290887
You could validate the user's permission on the Click event for the toplevel menu:
Private Sub mnuMyTopLevelMenu_Click()
'Get permissions
'If the current user passes your permission check
'For each lower level menu item: menuitem.Enabled = True
'Else
'For each lower...
Users of my software (http://www.stealthbot.net) recieved this error when their MSWINSCK.OCX control was outdated or nonexistent. Installing/registering MSWINSCK.OCX solved the problem.
My suggestion to you, as it may not be specific to MSWINSCK.OCX, is to verify that your target computer has...
Most prominently as I think of 1-based items right now is the ListView control and Collection objects. Dynamic arrays, listboxes, comboboxes, control arrays are all handled with a base of 0.
If you're not sure, you can open up a blank VB form, drop the desired control onto it and whip up some...
The simplest way to do this is using the KeyPress event:
Private Sub txtYourTextbox_KeyPress(KeyAscii as Integer)
If (KeyAscii = vbKeyReturn) Then 'ENTER key is pressed
Call cmdYourCommandButton_Click()
End If
End Sub
To open a PDF file:
'// declare:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'// usage...
Psuedocode:
Select Case LCase(txtPasswordInput.Text)
Case "user-level password"
'disable / make disappear all super-user controls
Case "superuser-level password"
'show all super-user controls
Case Else
'handle other passwords
End Select
That doesn't...
You'll want to unload all the forms in your program and erase all instantiated classes in the Form_Unload() event. Example:
Private Sub Form_Unload(Cancel as Integer)
Set clsLocalDataHandler = Nothing ' Instantiated class erased
Unload frmAbout 'Forms unloaded
Unload frmChat...
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.