uj5u.com熱心網友回復:
Point 方法示例本示例使用 Point 方法來確定一個表單上的一個指定點的顏色。要檢驗此示例,可將本例代碼粘貼到一個表單的宣告部分,然后按 F5 鍵并單擊該表單。
Private Sub Form_Click ()
Dim LeftColor, MidColor, Msg, RightColor ' 宣告變數。
AutoRedraw = -1 ' 打開AutoRedraw。
Height = 3 * 1440 ' 將高度設定為 3 英寸。
Width = 5 * 1440 ' 將寬度設定為 5 英寸。
BackColor = QBColor(1) ' 將背景設定為藍色。
ForeColor = QBColor(4) ' 將前景設定為紅色。
Line (0, 0)-(Width / 3, Height), , BF ' 紅框。
ForeColor = QBColor(15) ' 將前景設定為白色。
Line (Width / 3, 0)-((Width / 3) * 2, Height), , BF
LeftColor = Point(0, 0) ' 查找左框顏色,,
MidColor = Point(Width / 2, Height / 2) ' 中框, 和
RightColor = Point(Width, Height) ' 右框。
Msg = "The color number for the red box on the left side of "
Msg = Msg & "the form is " & LeftColor & ". The "
Msg = Msg & "color of the white box in the center is "
Msg = Msg & MidColor & ". The color of the blue "
Msg = Msg & "box on the right is " & RightColor & "."
MsgBox Msg ' 顯示資訊。
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/73759.html
標籤:VB基礎類
