大家都來幫我調整調整這個picture的位置, 我從上班以來就沒解決, 不知道是不是在混日子.
download url: http://www.4sea.org/temp/test-combo.rar
3kb
現在用另外一種方法替代解決, 但是任務攔回條出一個窗口,每次按combobox都會,所以得替換,
我寫了個上面的測試程序, 沒有窗口了, 但是picture的位置老是不對.
請大家幫我看看, 還有作測試的時候, 在父窗口多改變幾下UserControl11的位置.
问题点数:20、回复次数:6Top
1 楼netos(红海洋)回复于 2005-04-01 10:53:15 得分 0
還有,如何真真模擬combox, 比如在picture1顯示出來後,我按了父窗口的其他地方,picture1就隱藏了.Top
2 楼netos(红海洋)回复于 2005-04-01 15:00:16 得分 0
大家都在混日子?Top
3 楼netos(红海洋)回复于 2005-04-01 15:04:09 得分 0
大家都在混日子?Top
4 楼roger_xiong(卖女孩的小火柴~)回复于 2005-04-01 17:15:04 得分 20
Dim hWndDesktop As Long
Dim iLeft As Long
Dim iTop As Long
If Picture1.Visible = False Then
Picture1.Visible = True
UserControl.Width = 3015
UserControl.Height = 2000
Picture1.ZOrder (0)
Set m_ParentControl = txtMain
SetParent Picture1.hWnd, Parent.hWnd
' GetWindowRect Parent.hWnd, sRect
' GetWindowRect txtMain.hWnd, sRect1
' iLeft = sRect1.Left * 15
' iTop = sRect1.Bottom * 15
' Picture1.Left = iLeft
' 'Picture1.Left = sRect1.Left - sRect.Left
' 'Picture1.Top = sRect1.Top - sRect.Top + 350
Dim ctlTemp As Control
Dim i As Integer
With UserControl.ParentControls
For i = 0 To .Count - 1
'Ambient.DisplayName = .Item(i).Name
If Err.Number <> 0 Then
Err.Clear
ElseIf UserControl.Ambient.DisplayName = .Item(i).Name Then
Set ctlTemp = .Item(i)
Exit For
End If
Next i
End With
Picture1.Left = ctlTemp.Left + ctlTemp.Width
Picture1.Top = ctlTemp.Top
Else
Picture1.Visible = False
End If
Top
5 楼netos(红海洋)回复于 2005-04-01 18:19:22 得分 0
厲害, roger_xiong(卖女孩的小火柴~) 你幫助了我不少阿.Top
6 楼netos(红海洋)回复于 2005-04-01 18:19:34 得分 0
謝謝拉.Top




