Difference between revisions of "The Basics of VB6"
From Free Knowledge Base- The DUCK Project: information for everyone
m (→Resizing Forms =) |
m (Unsorted VB6 Notes moved to The Basics of VB6) |
||
(16 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
These notes can be organized later. | These notes can be organized later. | ||
− | === | + | === Select Case (Switch) === |
− | + | CASE in Visual BASIC does not "fall through" like in C. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Select Case Button.Key | |
+ | Case "ListCache" | ||
+ | mnuListCache_Click | ||
+ | Case "Refresh" | ||
+ | mnuRefresh_Click | ||
+ | Case "simmode" | ||
+ | cmdSimMode_Click | ||
+ | End Select | ||
− | + | Select Case tcpClient.State | |
+ | Case 0 | ||
+ | tcpClient.RemoteHost = cboRemoteHost | ||
+ | SessionConnect | ||
+ | Case 7 | ||
+ | lblStatus.Caption = "Connected" | ||
+ | Case 9 | ||
+ | lblStatus.Caption = "Connection Error" | ||
+ | End Select | ||
− | + | Case based on more than one condition | |
− | + | Select Case True | |
− | + | Case strMessage Like "*OK*" And lblStatus.Caption = "Connected" | |
− | + | blnReceivedAll = True | |
− | + | Case strMessage Like "*OK*" And lblStatus.Caption = "retrieving." | |
− | + | lblStatus.Caption = "retrieving.." | |
− | + | blnReceivedAll = True | |
+ | Case Else | ||
+ | Set LoopTime = New TimerClass: tmrDisconnect.Enabled = True | ||
+ | End Select | ||
− | === | + | === Public Declarations === |
+ | |||
+ | Public strCurrentTool As String | ||
+ | |||
+ | Public fMainForm As frmQAB | ||
+ | |||
+ | Public cn As ADODB.Connection | ||
+ | |||
+ | Public rsCompanies As ADODB.Recordset | ||
+ | |||
+ | Public Const dbtContact = "contact" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| |
Latest revision as of 10:55, 2 February 2008
These notes can be organized later.
Select Case (Switch)
CASE in Visual BASIC does not "fall through" like in C.
Select Case Button.Key Case "ListCache" mnuListCache_Click Case "Refresh" mnuRefresh_Click Case "simmode" cmdSimMode_Click End Select
Select Case tcpClient.State Case 0 tcpClient.RemoteHost = cboRemoteHost SessionConnect Case 7 lblStatus.Caption = "Connected" Case 9 lblStatus.Caption = "Connection Error" End Select
Case based on more than one condition
Select Case True Case strMessage Like "*OK*" And lblStatus.Caption = "Connected" blnReceivedAll = True Case strMessage Like "*OK*" And lblStatus.Caption = "retrieving." lblStatus.Caption = "retrieving.." blnReceivedAll = True Case Else Set LoopTime = New TimerClass: tmrDisconnect.Enabled = True End Select
Public Declarations
Public strCurrentTool As String
Public fMainForm As frmQAB
Public cn As ADODB.Connection
Public rsCompanies As ADODB.Recordset
Public Const dbtContact = "contact"