?? frmmedicfind.frm
字號:
TabIndex = 1
Top = 1680
Width = 2535
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Height = 375
Left = 9480
MouseIcon = "frmmedicfind.frx":79C8
MousePointer = 99 'Custom
TabIndex = 9
Top = 1440
Width = 975
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Height = 255
Left = 10800
MouseIcon = "frmmedicfind.frx":7B1A
MousePointer = 99 'Custom
TabIndex = 7
Top = 120
Width = 255
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Height = 375
Left = 9480
MouseIcon = "frmmedicfind.frx":7C6C
MousePointer = 99 'Custom
TabIndex = 6
Top = 2040
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Height = 495
Left = 9480
MouseIcon = "frmmedicfind.frx":7DBE
MousePointer = 99 'Custom
TabIndex = 5
Top = 840
Width = 975
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "等于(包含)"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4200
TabIndex = 4
Top = 1800
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "選 擇 查 詢 方 式:"
BeginProperty Font
Name = "楷體_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 1440
TabIndex = 2
Top = 1440
Width = 1995
End
End
End
Attribute VB_Name = "frmmedicfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
Option Explicit
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const RGN_XOR = 3
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Dim Xs As Long
Private Sub Form_Load()
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
Me.CreatePictureform
Combo1.AddItem "按名稱"
Combo1.AddItem "按類型"
Combo1.AddItem "按商品名"
Combo1.AddItem "按拼音簡碼"
End Sub
Function CreatePictureform()
On Error Resume Next
Dim hRgn As Long, hRect As RECT, hTempRgn As Long, tColour As Long, OldScaleMode As Integer, AbsoluteX As Long, AbsoluteY As Long
Dim Color As Long, Hrect1 As RECT
Dim xx As Long, yy As Long
Dim rtn As Long
Me.Picture = Me.Picture1
Me.Width = Me.Picture1.Width
Me.Height = Me.Picture1.Height
OldScaleMode = Me.ScaleMode
Me.AutoRedraw = True
Me.ScaleMode = 3
Color = vbWhite
rtn = GetWindowRect(Me.hwnd, hRect)
hRgn = CreateRectRgn(0, 0, hRect.right, hRect.bottom)
For AbsoluteX = 0 To Me.ScaleWidth
For AbsoluteY = 0 To Me.ScaleHeight
tColour = GetPixel(Me.hdc, AbsoluteX, AbsoluteY)
If tColour = Color Then
hTempRgn = CreateRectRgn(AbsoluteX, AbsoluteY, AbsoluteX + 1, AbsoluteY + 1)
rtn = CombineRgn(hRgn, hRgn, hTempRgn, RGN_XOR)
rtn = DeleteObject(hTempRgn)
End If
Next AbsoluteY
Next AbsoluteX
rtn = SetWindowRgn(Me.hwnd, hRgn, True)
DeleteObject hRgn
Me.ScaleMode = OldScaleMode
If Err Then
MsgBox Error, 16, Err
End If
End Function
Private Sub LblExit_Click()
End
End Sub
Private Sub Lblzhuche_Click()
frmadduser.Show
Unload Me
End Sub
Private Sub Label3_Click()
If Combo1.Text = "按名稱" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where medicname like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按類型" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where leixing like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按商品名" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where shangpinming like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按拼音簡碼" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where pingyinjianma like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
End Sub
Private Sub Label4_Click()
Unload Me
Main.Show
End Sub
Private Sub Label5_Click()
Unload Me
Main.Show
End Sub
Private Sub Label6_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Dim ReturnVal As Long
Xs = ReleaseCapture()
ReturnVal = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Combo1.Text = "按名稱" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where medicname like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按類型" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where leixing like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按商品名" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where shangpinming like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Combo1.Text = "按拼音簡碼" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from medicdate where pingyinjianma like '%" & Text1.Text & "%'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -