看板 Visual_Basic 關於我們 聯絡資訊
請教一下,為什麼這樣寫沒辦法正常工作? sorry~~經驗不足,看不出怎麼改才對~>"< 卡在這~~~幫忙推一下! 我主要是有n個shape 利用MOUSE的點選及list1~3 選的數字 來決定對應的HByteR HByteG.... MOUSE沒選任何shape時,這些HByteR HByteG.... 都為初值 如 : text1=0000000000000000000000000..... 當mouse點選shape中的某個時..... text1只改變對應的0,但沒選的都還是0 有選的那幾個會改而已..... 我這樣寫離功能會差很遠嗎? 怎麼寫會比較好呢? Dim User_Flag As Boolean Dim DataRGB As Long Dim DataR(0) As String Dim DataG(127) As String Dim DataB(127) As String Dim HByteR(127) As String Dim LByteR(127) As String Dim HByteG(127) As String Dim LByteG(127) As String Dim HByteB(127) As String Dim LByteB(127) As String Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If User_Flag = True Then For i = 0 To 2 If (X > Shape1(i).Left And X < Shape1(i).Left + Shape1(i).Height) And (Y > Shape1(i).Top And Y < Shape1(i).Top + Shape1(i).Height) Then Shape1(i).BackColor = RGB(List1.List(List1.TopIndex), List2.List(List2.TopIndex), List3.List(List3.TopIndex)) HByteR(i) = Left(Hex(List1.List(List1.TopIndex)), 2) LByteR(i) = Right(Hex(List1.List(List1.TopIndex)), 2) HByteG(i) = Left(Hex(List2.List(List2.TopIndex)), 2) LByteG(i) = Right(Hex(List2.List(List2.TopIndex)), 2) HByteB(i) = Left(Hex(List3.List(List3.TopIndex)), 2) LByteB(i) = Right(Hex(List3.List(List3.TopIndex)), 2) End If Next i Text4.Text = Chr("&H" & HByteR(0)) & Chr("&H" & LByteR(0)) & Chr("&H" & HByteG(0)) & Chr("&H" & LByteG(0)) & Chr("&H" & HByteB(0)) & Chr("&H" & LByteB(0)) & Chr("&H" & HByteR(1)) & Chr("&H" & LByteR(1)) & Chr("&H" & HByteG(1)) & Chr("&H" & LByteG(1)) & Chr("&H" & HByteB(1)) & Chr("&H" & LByteB(1)) & Chr("&H" & HByteR(2)) & Chr("&H" & LByteR(2)) & Chr("&H" & HByteG(2)) & Chr("&H" & LByteG(2)) & Chr("&H" & HByteB(2)) & Chr("&H" & LByteB(2)) End If End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.12.186 ※ 編輯: CuckooBoy 來自: 123.195.12.186 (12/24 18:17)
DRAGONLL:要不要考慮三條 HScroll的拉動來控制輸出的RGB圖 12/24 19:15
DRAGONLL:會簡單很多 12/24 19:16
CuckooBoy:MAX沒辦法到65536,所以才用List 12/24 20:08
CuckooBoy:現在沒辦法改變text1中某個位元的資料 12/24 20:16
CuckooBoy:類似預設0的暫存器,依滑鼠點哪一個的位置去改變相對位置 12/24 20:17
CuckooBoy:的位元,最後再一起將資料送出去,送出去前都可以改變 12/24 20:19
※ 編輯: CuckooBoy 來自: 123.195.12.186 (12/24 20:23)