📄 frmiointerface.frm
字号:
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Do not allow the user to close the window instead
'just hide it.
If UnloadMode = vbFormControlMenu Then
Cancel = 1
End If
' Me.Hide
frmControl.chkIOInterface.value = 0
mdiMain.tlbMainToolBar.Buttons("ioconfig").value = tbrUnpressed
'Unpress its toolbar button
'mdiMain.tbrMain.Buttons("IOToolWindow").value = tbrUnpressed
End Sub
Private Sub optIOInterface_Click()
'This code makes a MouseUp event like a Click event
'This is usefull for making a check boxes where you want something to
'happen when the checkbox is clicked and not when its value changes.
'Checkboxes have an iritating feature where they fire the click event
'when the value changes.
' If optIOInterface(0).value = True Then
'If they choose to use the serial I/O Interface then
'enable all of the controls for configuring
'the serial I/O Interface
' chkLSBFirst.Enabled = True
' lbl2or3Wire.Enabled = True
' lsbIOMode2or3Wire.Enabled = True
' cmdLoadSerialCommInfo.Enabled = True
' fraSerialComm.Enabled = True
' cmdIOReset.Enabled = True
' Else
'If they choose to use the parallel I/O Interface then
'disable all of the controls for configuring
'the serial I/O Interface
' chkLSBFirst.Enabled = False
' lbl2or3Wire.Enabled = False
' lsbIOMode2or3Wire.Enabled = False
' cmdLoadSerialCommInfo.Enabled = False
' fraSerialComm.Enabled = False
' cmdIOReset.Enabled = False
' End If
End Sub
Private Sub optIOInterface_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If Button = vbLeftButton Then
' With optIOInterface(Index)
' If X >= 0 And X <= .Width And Y >= 0 And Y <= .Height Then
' 'This code only runs when the checkbox is clicked
' EvalBoard.SPMode = Index
' frmDebug.RefreshStatus
' End If
' End With
' End If
End Sub
Private Sub imgFormCloseButton_Click()
Dim Cancel As Integer
Dim umode As Integer
Form_QueryUnload Cancel, umode
End Sub
Private Sub imgFormCloseButton_DblClick()
Dim Cancel As Integer
Dim umode As Integer
Form_QueryUnload Cancel, umode
End Sub
Private Sub imgFormCloseButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Show the pressed state
imgFormCloseButton.Tag = 1
imgFormCloseButton.Picture = imgFormCloseBtnBfr(1).Picture
End If
End Sub
Private Sub imgFormCloseButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Show the pressed state
imgFormCloseButton.Tag = 1
imgFormCloseButton.Picture = imgFormCloseBtnBfr(1).Picture
Else
'Show the unpressed state
imgFormCloseButton.Tag = 0
imgFormCloseButton.Picture = imgFormCloseBtnBfr(0).Picture
End If
End Sub
Private Sub imgFormCloseButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Show the unpressed state
imgFormCloseButton.Tag = 0
imgFormCloseButton.Picture = imgFormCloseBtnBfr(0).Picture
End If
End Sub
Private Sub imgShade_Click()
'Check the form state if
If imgShade.Tag = "0" Or imgShade.Tag = "2" Then
imgShade.Tag = "1"
imgShade.Picture = imgShadeBfr(1).Picture
Me.Height = 345
Else
imgShade.Tag = "0"
imgShade.Picture = imgShadeBfr(0).Picture
Me.Height = 3945
End If
End Sub
Private Sub imgShade_DblClick()
imgShade_Click
End Sub
Private Sub imgShade_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Select the proper button pressed picture
If imgShade.Tag = "0" Then
imgShade.Tag = "2"
Else
imgShade.Tag = "3"
End If
'Draw the picture
imgShade.Picture = imgShadeBfr(imgShade.Tag).Picture
End If
End Sub
Private Sub imgShade_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Select the proper button pressed picture
If imgShade.Tag = "2" Then
imgShade.Tag = "0"
Else
imgShade.Tag = "1"
End If
'Draw the picture
imgShade.Picture = imgShadeBfr(imgShade.Tag).Picture
End If
End Sub
Private Sub lblFakeTitleBarText_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
pbxFakeTitleBar_MouseDown Button, Shift, X, Y
End Sub
Private Sub lsbSerialIOMode_Click()
'Set the bit value in the register map
'If the form isn't being updated then set the bit in the registermap
If Not IsUpdating Then
mvarNeedsLoading = True
End If
End Sub
Private Sub pbxFakeTitleBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Move the form based on the user clicking
If Button = 1 Then
ReleaseCapture
SendMessage Me.hWnd, &HA1, 2, 0&
End If
End Sub
Private Sub picRollUpDwn_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If Button = vbLeftButton Then
' With picRollUpDwn
' If X >= 0 And X <= .Width And Y >= 0 And Y <= .Height Then
' 'Draw button hilight
' .ForeColor = &H80000014
' picRollUpDwn.Line (.Width - 15, 0)-(.Width - 15, .Height)
' picRollUpDwn.Line (0, .Height - 15)-(.Width, .Height - 15)
' 'Draw button shadow
' .ForeColor = &H80000015
' picRollUpDwn.Line (0, 0)-(.Width, 0)
' picRollUpDwn.Line (0, 0)-(0, .Height)
' End If
'
' 'If the form is rolled down then draw the up arrow
' If .Tag = "Down" Then
' 'Draw the up arrow
' .ForeColor = &H80000014
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 3)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' .ForeColor = &H80000015
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 3)
' Else
' 'Draw the down arrow
' .ForeColor = &H80000014
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 13)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' .ForeColor = &H80000015
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 13)
' End If
' End With
' End If
End Sub
Private Sub picRollUpDwn_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Static CtrMov As Boolean
'With picRollUpDwn 'Change this 'txtCPIsetResValue' to your control name
' If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
' ReleaseCapture
' CtrMov = False
'
' 'Put here your code to LostMouseFocus
' 'For example:
' .BackColor = &H8000000F
'
' 'Draw button outline
' .ForeColor = &H80000010
' picRollUpDwn.Line (.Width - 15, 0)-(.Width - 15, .Height)
' picRollUpDwn.Line (0, .Height - 15)-(.Width, .Height - 15)
' picRollUpDwn.Line (0, 0)-(.Width, 0)
' picRollUpDwn.Line (0, 0)-(0, .Height)
'
' 'If the form is rolled down then draw the up arrow
' If .Tag = "Down" Then
' 'Draw the up arrow outline
' .ForeColor = &H80000010
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 3)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 3)
' Else
' 'Draw the down arrow outline
' .ForeColor = &H80000010
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 13)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 13)
' End If
' Else
' SetCapture .hWnd
' If CtrMov = False Then
' CtrMov = True
' 'Put here your code to GetMouseFocus
' 'For example:
'
' End If
' .BackColor = &HFF00&
' 'Draw button shadow
' .ForeColor = &H80000015
' picRollUpDwn.Line (.Width - 15, 0)-(.Width - 15, .Height)
' picRollUpDwn.Line (0, .Height - 15)-(.Width, .Height - 15)
' 'Draw button hilight
' .ForeColor = &H80000014
' picRollUpDwn.Line (0, 0)-(.Width, 0)
' picRollUpDwn.Line (0, 0)-(0, .Height)
'
' 'If the form is rolled down then draw the up arrow
' If .Tag = "Down" Then
' 'Draw the up arrow
' .ForeColor = &H80000015
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 3)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' .ForeColor = &H80000014
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 3)
' Else
' 'Draw the down arrow
' .ForeColor = &H80000015
' picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 13)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
' .ForeColor = &H80000014
' picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 13)
' End If
' End If
'End With
End Sub
Private Sub picRollUpDwn_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static firsttime As Boolean
Static OldHeight As Single
'This code makes a MouseUp event like a Click event
'This is usefull for making a check boxes where you want something to
'happen when the checkbox is clicked and not when its value changes.
'Checkboxes have an iritating feature where they fire the click event
'when the value changes.
If Button = vbLeftButton Then
'Store the old form height
If firsttime = False Then
OldHeight = Me.Height
firsttime = True
picRollUpDwn.Tag = "Down"
End If
With picRollUpDwn
If X >= 0 And X <= .Width And Y >= 0 And Y <= .Height Then
'This code only runs when the checkbox is clicked
If .Tag = "Down" Then
Do While Me.Height > 585
'Resize by 4 pixels
Me.Move Me.Left, Me.Top, Me.Width, Me.Height - Screen.TwipsPerPixelY * 16
Me.Refresh
'Allow windows to process events
DoEvents
Loop
'Make sure its the right height
Me.Move Me.Left, Me.Top, Me.Width, 585
Me.Refresh
'Set the tag to show the that the for is rolled up
.Tag = "Up"
Else
Do While Me.Height < OldHeight
'Resize by 4 pixels
Me.Move Me.Left, Me.Top, Me.Width, Me.Height + Screen.TwipsPerPixelY * 16
Me.Refresh
'Allow windows to process events
DoEvents
Loop
'Make sure its the right height
Me.Move Me.Left, Me.Top, Me.Width, OldHeight
Me.Refresh
'Set the tag to show the that the for is rolled down
.Tag = "Down"
End If
'Release the mouse capture
ReleaseCapture
.BackColor = &H8000000F
'Draw button outline
.ForeColor = &H80000010
picRollUpDwn.Line (.Width - 15, 0)-(.Width - 15, .Height)
picRollUpDwn.Line (0, .Height - 15)-(.Width, .Height - 15)
picRollUpDwn.Line (0, 0)-(.Width, 0)
picRollUpDwn.Line (0, 0)-(0, .Height)
'If the form is rolled down then draw the up arrow
If .Tag = "Down" Then
'Draw the up arrow outline
.ForeColor = &H80000010
picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 3)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 13)
picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 3)
Else
'Draw the down arrow outline
.ForeColor = &H80000010
picRollUpDwn.Line (.Width / 2, Screen.TwipsPerPixelY * 13)-((.Width / 2) - (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
picRollUpDwn.Line -((.Width / 2) + (Screen.TwipsPerPixelX * 10), Screen.TwipsPerPixelY * 3)
picRollUpDwn.Line -(.Width / 2, Screen.TwipsPerPixelY * 13)
End If
End If
End With
End If
End Sub
Public Property Get NeedsLoading() As Boolean
'Return the current value
NeedsLoading = mvarNeedsLoading
End Property
Public Property Let NeedsLoading(ByVal vNewValue As Boolean)
'Set the new value
' mvarNeedsLoading = vNewValue
' If mvarNeedsLoading = False Then
' cmdLoad.BackColor = vb3DFace
' Else
' If mvarNeedsLoading = True And frmControl.NeedsLoading = False Then
' 'Set the needsloading flag for the control window
' 'also because it loads the same data
' frmControl.NeedsLoading = True
' End If
' End If
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -