[請益] 圖層重疊的問題
恩  如果今天一個FORM 上面  我有  button  image1   image2(i)陣列 三個物件
然後一開始image1便插入一張圖片
接著我希望按下button 後便會利用image2陣列來把image1畫分成好幾塊
image2(0)  一開使的設定 borderStytle = 1 , appearance = 0  ,visible=false
且image2(0)和imge1的左上角是重疊的  我的程式碼如下
Private Sub Command1_Click()
With Image2(i)
Image2(0).Width = Image1.Width / 10
Image2(0).Height = Image1.Height / 10
Dim nimg(0 To 99) As Integer
Dim ctop As Single, cleft As Single
i = 1
ctop = Image2(0).Top
cleft = Image2(0).Left
x = Image1.Left
y = Image1.Top
While y < Image1.Top + Image1.Height
    While x < Image1.Left + Image1.Width
        Load Image2(i)
        Image2(i).Top = ctop
        Image2(i).Left = cleft
        Image2(i).Visible = True
        cleft = cleft + Image2(0).Width
        i = i + 1
        x = x + Image2(0).Width
    Wend
    ctop = ctop + Image2(0).Height
    cleft = Image2(0).Left
    y = y + Image2(0).Height
    x = Image1.Left
Wend
End With
End Sub
可是最後有一個問題...就是好像image1覆蓋住了image2陣列  沒有產生出我想要的
把image1分成好幾個區域
因為我後來嘗試把image1拉到別的地方   接著再啟動程式
這時候原來image1的地方   就有image2陣列了......
所以請問各位高手   如何才能讓image2陣列  覆蓋image1  拜託嚕
--
※ 發信站: 批踢踢實業坊(ptt.cc) 
◆ From: 220.132.148.99
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章
                            12
                        
                            32