vb愛心程序代碼教程(vbs心形代碼)
本篇文章給大家談?wù)剉b愛心程序代碼教程,以及vbs心形代碼對(duì)應(yīng)的知識(shí)點(diǎn),希望對(duì)各位有所幫助,不要忘了收藏本站喔。
本文目錄一覽:
用VB程序怎么做一個(gè)心型圖?
Dim X1, Y1, X2, Y2 As Integer\x0d\x0aDim I As Integer\x0d\x0aDim J As Boolean\x0d\x0aDim K As IntegerDim WithEvents Label1 As Label\x0d\x0aDim WithEvents Timer1 As TimerPrivate Sub Form_Activate()\x0d\x0a I = 100\x0d\x0a K = 100\x0d\x0a X1 = Me.Width / 2\x0d\x0a Y1 = Me.Height / 3\x0d\x0a X2 = X1\x0d\x0a Y2 = Y1\x0d\x0aLabel1.Top = Me.Height / 2 - Label1.Height / 2\x0d\x0a Label1.Left = Me.Width / 2 - Label1.Width / 2\x0d\x0aEnd SubPrivate Sub Form_Load() Me.BackColor = H0\x0d\x0a Me.FillColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)\x0d\x0a Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)\x0d\x0a Me.DrawMode = 13\x0d\x0a Me.DrawWidth = 2\x0d\x0a Me.FillStyle = 7\x0d\x0aSet Label1 = Me.Controls.Add("VB.Label", "Label1")\x0d\x0a Set Timer1 = Me.Controls.Add("VB.Timer", "Timer1")\x0d\x0aLabel1.Visible = True\x0d\x0a Label1.AutoSize = True\x0d\x0a Label1.BackStyle = 0\x0d\x0a Label1.Caption = "I LOVE YOU"\x0d\x0a Label1.Font.Size = 60\x0d\x0a Label1.ForeColor = HFF00\x0d\x0a Timer1.Enabled = True\x0d\x0a Timer1.Interval = 10\x0d\x0a Me.WindowState = 2\x0d\x0aEnd SubPrivate Sub Timer1_Timer()\x0d\x0a Me.Circle (X1, Y1), 250\x0d\x0a Me.Circle (X2, Y2), 250\x0d\x0a \x0d\x0a If Y1 = Me.Height / 3 Then\x0d\x0a K = K - 5\x0d\x0a End If\x0d\x0a Else\x0d\x0a I = 100\x0d\x0a K = 100\x0d\x0a X1 = Me.Width / 2\x0d\x0a Y1 = Me.Height / 3\x0d\x0a X2 = X1\x0d\x0a Y2 = Y1\x0d\x0a \x0d\x0a Me.FillColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)\x0d\x0a Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End If\x0d\x0a \x0d\x0a Me.DrawWidth = 3\x0d\x0a \x0d\x0a Me.PSet (Rnd * Me.Width, Rnd * Me.Height), RGB(Rnd * 225, Rnd * 225, Rnd * 225)\x0d\x0a Me.DrawWidth = 2\x0d\x0aEnd SubPrivate Sub Form_Click()\x0d\x0a End\x0d\x0aEnd SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)\x0d\x0a End\x0d\x0aEnd Sub
VB 怎么弄成心形
'你們的太難看了,看我的畫圖法
'把下面的代碼放在窗體里,運(yùn)行,單擊窗體看看
Private Sub Form_Click()
ScaleMode = vbPixels
Circle (20, 20), 10, , 0, 3.2
Circle (40, 20), 10, , 0, 3.2
Line (10, 20)-(30, 50)
Line (50, 20)-(30, 50)
PSet (30, 50)
End Sub
如何用vb編寫個(gè)表白程序
簡(jiǎn)單啊~
打開VB新建一個(gè)exe工程;
按下F7打開代碼窗體;
寫入以下代碼并生成exe發(fā)送給對(duì)方即可。
Private?Sub?Form_Load()
????MsgBox?"I?love?you~"
????MsgBox?"真的!"
????MsgBox?"..."
End?Sub
MsgBox請(qǐng)自由更改以及添加,想說多少加多少。
VB編寫愛心形狀的窗體
你的描述我不是很明白,可以給你個(gè)思路!首先找個(gè)愛心形狀的圖片,加載進(jìn)窗體的picturebox中,調(diào)整到合適大小。然后用以下讓窗體透明。'設(shè)置Me.BorderStyle = 0
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = H2
Private Const LWA_COLORKEY = H1
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = HA1
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
Me.BackColor = HFF0000
Dim rtn As Long
rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, HFF0000, 0, LWA_COLORKEY
End Sub
關(guān)于vb愛心程序代碼教程和vbs心形代碼的介紹到此就結(jié)束了,不知道你從中找到你需要的信息了嗎 ?如果你還想了解更多這方面的信息,記得收藏關(guān)注本站。
掃描二維碼推送至手機(jī)訪問。
版權(quán)聲明:本文由飛速云SEO網(wǎng)絡(luò)優(yōu)化推廣發(fā)布,如需轉(zhuǎn)載請(qǐng)注明出處。