Private Sub ShowList()
If m_DataSource Is Nothing Then Exit Sub
If m_DataSource.State = 0 Then Exit Sub
If m_DataSource.RecordCount = 0 Then Exit Sub
'将combobox locked,以避免combobox自动清空
' txtData.Locked = True
If Not InitList() Then Exit Sub
'取得usercontrol的位置
Dim rcWnd As rect
Dim cxScreen As Long
Dim cyScreen As Long
GetWindowRect UserControl.hwnd, rcWnd
mdlCommon.rcControl = rcWnd
' Screen.TwipsPerPixelX 为将pixel座标转成Twip座标
frmList.Left = rcWnd.Left * Screen.TwipsPerPixelX
frmList.Top = rcWnd.Bottom * Screen.TwipsPerPixelY
'此段code为判断list是否已超出Screen area
'若超出,则改变其show 出方向、座标
cxScreen = GetSystemMetrics(SM_CXSCREEN)
If cxScreen And _
(frmList.Left + frmList.Width) > cxScreen * Screen.TwipsPerPixelX Then
frmList.Left = cxScreen * Screen.TwipsPerPixelX - frmList.Width - 100
End If
cyScreen = GetSystemMetrics(SM_CYSCREEN)
If cyScreen And _
(frmList.Top + frmList.Height + 600) > cyScreen * Screen.TwipsPerPixelY Then
frmList.Top = rcWnd.Top * Screen.TwipsPerPixelY - frmList.Height
End If
'0122
frmList.Show vbModal, Me
If strVersion <> "2000" Then
frmList.Show vbModal, Me
VBA.SendKeys "{TAB}"
Call keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_TAB, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_TAB, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If
End Sub
If m_DataSource Is Nothing Then Exit Sub
If m_DataSource.State = 0 Then Exit Sub
If m_DataSource.RecordCount = 0 Then Exit Sub
'将combobox locked,以避免combobox自动清空
' txtData.Locked = True
If Not InitList() Then Exit Sub
'取得usercontrol的位置
Dim rcWnd As rect
Dim cxScreen As Long
Dim cyScreen As Long
GetWindowRect UserControl.hwnd, rcWnd
mdlCommon.rcControl = rcWnd
' Screen.TwipsPerPixelX 为将pixel座标转成Twip座标
frmList.Left = rcWnd.Left * Screen.TwipsPerPixelX
frmList.Top = rcWnd.Bottom * Screen.TwipsPerPixelY
'此段code为判断list是否已超出Screen area
'若超出,则改变其show 出方向、座标
cxScreen = GetSystemMetrics(SM_CXSCREEN)
If cxScreen And _
(frmList.Left + frmList.Width) > cxScreen * Screen.TwipsPerPixelX Then
frmList.Left = cxScreen * Screen.TwipsPerPixelX - frmList.Width - 100
End If
cyScreen = GetSystemMetrics(SM_CYSCREEN)
If cyScreen And _
(frmList.Top + frmList.Height + 600) > cyScreen * Screen.TwipsPerPixelY Then
frmList.Top = rcWnd.Top * Screen.TwipsPerPixelY - frmList.Height
End If
'0122
frmList.Show vbModal, Me
If strVersion <> "2000" Then
frmList.Show vbModal, Me
VBA.SendKeys "{TAB}"
Call keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_TAB, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_TAB, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If
End Sub