vb简单代码画漂亮窗体Word格式.docx

上传人:b****4 文档编号:7630239 上传时间:2023-05-08 格式:DOCX 页数:29 大小:39.15KB
下载 相关 举报
vb简单代码画漂亮窗体Word格式.docx_第1页
第1页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第2页
第2页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第3页
第3页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第4页
第4页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第5页
第5页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第6页
第6页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第7页
第7页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第8页
第8页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第9页
第9页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第10页
第10页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第11页
第11页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第12页
第12页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第13页
第13页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第14页
第14页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第15页
第15页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第16页
第16页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第17页
第17页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第18页
第18页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第19页
第19页 / 共29页
vb简单代码画漂亮窗体Word格式.docx_第20页
第20页 / 共29页
亲,该文档总共29页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

vb简单代码画漂亮窗体Word格式.docx

《vb简单代码画漂亮窗体Word格式.docx》由会员分享,可在线阅读,更多相关《vb简单代码画漂亮窗体Word格式.docx(29页珍藏版)》请在冰点文库上搜索。

vb简单代码画漂亮窗体Word格式.docx

[lefttoRight]=1

EndEnum

DimCAsBoolean

PrivateDeclareFunctionSendMessage&

Lib"

user32"

Alias"

SendMessageA"

(ByValhwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)

PrivateDeclareFunctionCreatePolygonRgnLib"

gdi32"

(lpPointAsPOINTAPI,ByValnCountAsLong,ByValnPolyFillModeAsLong)AsLong

PrivateDeclareFunctionCreateRectRgnLib"

(ByValx1AsLong,ByValy1AsLong,ByValx2AsLong,ByValy2AsLong)AsLong

PrivateDeclareFunctionCreateRoundRectRgnLib"

(ByValx1AsLong,ByValy1AsLong,ByValx2AsLong,ByValy2AsLong,ByValX3AsLong,ByValy3AsLong)AsLong

PrivateDeclareFunctionDeleteObjectLib"

(ByValhObjectAsLong)AsLong

PrivateDeclareFunctionCreateSolidBrushLib"

(ByValcrColorAsLong)AsLong

PrivateDeclareFunctionFrameRgnLib"

(ByValhdcAsLong,ByValhRgnAsLong,ByValhBrushAsLong,ByValnWidthAsLong,ByValnHeightAsLong)AsLong

PrivateDeclareFunctionReleaseCaptureLib"

()AsLong

PrivateDeclareFunctionSetCaptureLib"

(ByValhwndAsLong)AsLong

PrivateDeclareFunctionSetWindowRgnLib"

(ByValhwndAsLong,ByValhRgnAsLong,ByValbRedrawAsBoolean)AsLong

DimWithEventsPicture1AsPictureBox‘声明窗体

DimWithEventsPicture2AsPictureBox‘关闭按扭

DimWithEventsPicture3AsPictureBox‘最小化

DimWithEventsLoadingAsPictureBox‘登录按扭

DimWithEventsCancelAsPictureBox‘取消按扭

DimWithEventsUPAsPictureBox‘文本框边

DimWithEventsPPAsPictureBox‘文本框边

DimUserLaBelAsLabel‘标签

DimPasswordLaBelAsLabel‘标签

DimWithEventsuTextAsTextBox‘帐号文本

DimWithEventsPTextAsTextBox‘密码文本

DimStylAsBoolean

PrivateSubLoadWindow()

DimiAsLong

DimcolorAsLong

DimW,hAsLong

Fori=1To405

color=color+1

Picture1.Line(0,i)-(Picture1.ScaleWidth,i),RGB(0,255,color)‘画出窗体标题栏

Nexti

Picture1.ForeColor=vbBlue

Picture1.FontSize=10

Picture1.CurrentX=200

Picture1.CurrentY=100

Picture1.PrintMe.Caption

Fori=1To25

Picture1.Line(i,0)-(i,Picture1.ScaleHeight),RGB(0,255,color)

Fori=Picture1.ScaleWidth-55ToPicture1.ScaleWidth

Fori=Picture1.ScaleHeight-55ToPicture1.ScaleHeight

Picture1.Line(0,i)-(ScaleWidth,i),RGB(0,255,color)

DimRgnAsLong

DimBrushAsLong

W=Picture1.ScaleWidth

h=Picture1.ScaleHeight

Rgn=CreateRoundRectRgn(0,0,Picture1.ScaleX(Picture1.Width,vbTwips,vbPixels),Picture1.ScaleY(Picture1.Height+200,vbTwips,vbPixels),12,12)

SetWindowRgnPicture1.hwnd,Rgn,True‘删除窗体上面两个角

DeleteObjectRgn

Brush=CreateSolidBrush(0)

FrameRgnPicture1.hdc,Rgn,Brush,1,1

Picture1.Line(0,Picture1.ScaleHeight-10)-(Picture1.ScaleWidth,Picture1.ScaleHeight-10),0

DeleteObjectBrush

Rgn=CreateRectRgn(3,27,Picture1.ScaleWidth/15-4,Picture1.ScaleHeight/15-3)

EndSub

PrivateSubCommand1_Click()

PrivateSubForm_Load()

Me.Width=6680

Me.Height=5580

Me.BackColor=&

H808080

Me.Caption="

VB画漂亮窗体"

Styl=False

SetPicture1=Me.Controls.Add("

vb.picturebox"

"

picture1"

Me)

WithPicture1

.Width=4575

.Height=3615

.Left=800

.Top=800

.BorderStyle=0

.Visible=True

EndWith

SetPicture2=Me.Controls.Add("

picture2"

Picture1)

WithPicture2

.Width=300

.Left=Picture1.Width-400

.Height=300

.Top=80

SetPicture3=Me.Controls.Add("

picture3"

Picture3.Top=80

Picture3.Left=Picture2.Left-320

Picture3.Width=300

Picture3.Height=300

Picture3.BorderStyle=0

Picture3.Visible=True

SetUserLaBel=Me.Controls.Add("

vb.Label"

uL"

WithUserLaBel

.Top=1000

.Caption="

用户名(&

U):

"

.ForeColor=vbBlue

.Width=1000

.BackStyle=0

SetPasswordLaBel=Me.Controls.Add("

PL"

WithPasswordLaBel

.Top=1600

密码(&

P):

SetUP=Me.Controls.Add("

UP"

WithUP

.Top=930

.Left=1800

.Width=1900

.Height=330

.BackColor=vbWhite

SetuText=Me.Controls.Add("

VB.textbox"

ut"

UP)

WithuText

.Top=30

.Left=200

.Width=1500

.Height=250

SetPP=Me.Controls.Add("

PP"

WithPP

.Top=1500

SetPText=Me.Controls.Add("

Pt"

PP)

WithPText

.PasswordChar="

*"

SetLoading=Me.Controls.Add("

Loading1"

WithLoading

.Top=2500

.Width=800

.Height=350

.Appearance=0

SetCancel=Me.Controls.Add("

Cancel"

WithCancel

.Left=3000

PrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)

PP_Paint

PrivateSubPicture1_Paint()

LoadWindow

PrivateSubDrawcolor(ByValobjectAsObject,ByValcrColor1AsLong,crColor2AsLong,ByValFAsBoolean)

DimW,hAsLong

DimuHAsSingle,uWAsSingle

DimrInfoAsSingle,gInfoAsSingle,bInfoAsSingle

DimrStaAsLong,gStaAsLong,bStaAsLong

DimrEndAsLong,gEndAsLong,bEndAsLong

DimRAsLong,GAsLong,BAsLong,iAsLong

uH=object.ScaleHeight:

uW=object.ScaleWidth

rSta=crColor1Mod256

gSta=crColor1\256Mod256

bSta=crColor1\256\256

rEnd=crColor2Mod256

gEnd=crColor2\256Mod256

bEnd=crColor2\256\256

IfF=TrueThen

rSta=rSta*1.2:

gSta=gSta*1.2:

bSta=bSta*1.2

rEnd=rEnd*1.2:

gEnd=gEnd*1.2:

bEnd=bEnd*1.2

rInfo=(rEnd-rSta)/uH

gInfo=(gEnd-gSta)/uH

bInfo=(bEnd-bSta)/uH

Fori=0TouH-1

R=rSta+i*rInfo

G=gSta+i*gInfo

B=bSta+i*bInfo

object.Line(0,i)-(uW-1,i),RGB(R,G,B)

Else

EndIf

PrivateSubPicture1_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)

ReleaseCapture

SendMessagePicture1.hwnd,&

HA1,2,0&

‘移动里面的窗体

PrivateSubPicture2_Click()

Picture1.Visible=False

PrivateSubPicture2_Paint()

DrawcolorPicture2,255,vbWhite,True

W=Picture2.ScaleWidth/Screen.TwipsPerPixelX

h=Picture2.ScaleHeight/Screen.TwipsPerPixelY

Rgn=CreateRoundRectRgn(0,0,W,h,3,3)

SetWindowRgnPicture2.hwnd,Rgn,True

Brush=CreateSolidBrush(123)

FrameRgnPicture2.hdc,Rgn,Brush,1,1

Picture2.DrawWidth=2

Picture2.Line(70,70)-(230,230),&

Picture2.Line(230,70)-(70,230),&

PrivateSubPicture3_Paint()

DrawcolorPicture3,&

HFF8080,vbWhite,True

W=Picture3.ScaleWidth/Screen.TwipsPerPixelX

h=Picture3.ScaleHeight/Screen.TwipsPerPixelY

SetWindowRgnPicture3.hwnd,Rgn,True

FrameRgnPicture3.hdc,Rgn,Brush,1,1

Picture3.DrawWidth=2

Picture3.Line(70,170)-(230,170),&

PrivateSubPText_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)

DimRgnAsLong

DimBrushAsLong

W=PP.ScaleWidth/Screen.TwipsPerPixelX

h=PP.ScaleHeight/Screen.TwipsPerPixelY

IfX>

=0AndX<

=PText.WidthAndY>

=0AndY<

=PText.HeightThen

Rgn=CreateRoundRectRgn(0,0,W,h,20,20)

Brush=CreateSolidBrush(vbGreen)

FrameRgnPP.hdc,Rgn,Brush,1,1

DeleteObjectRgn

DeleteObjectBrush

SetCapturePText.hwnd

Brush=CreateSolidBrush(&

H80FF80)

EndSub

PrivateSubUText_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)

W=UP.

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2