Ӧ
Computer Applications
1999 198 Vol.19No.8 1999



VBʵõıӡһ
á
ժҪͨVBʵֱӡļַĸҪṩһVBȫϵôӡܵʵַ
ؼʡVisual Basic,ӡ
Visual BasicһԼǿ¼ı̹ߣ򵥸Чѧöм㷺ûVBʵõĹܣûҪжʵַ
VBеĴ弰ͼԿΪҿɽֱӡһǿڴϼһͼͼPrint CircleȷͼʵûȻͼPaintpictureʵֱĴӡһ棬ǿԽһΪޱ߿޿ʽȻPrintCircleȷֺͼ򵥵ļͼΣɷLabelImageȿؼֻͼ񣬻VBؼʵûҪıȻôPrintformʵ༭ӡ
ͼʾĴӡĻʾΧڵݣʵϵõĹܡͼǱˮƽʹֱʵĳĻݵȱ޷ӡϵLabelGridȶ󣻶ڴӡ壬Ǳһӣ弰ϵݰմӡСĻʾȱ޷Դӡ100%ȫԤ
ڹʵУһַַܵŵ㣬ʵȫϵõĹܣֽܸߣϣܶԴ档
1
ΪĻģӡЧȻVBһģӡֽΪô˴ʾΪӡֽʵʴСǻĿмһ壬֮ΪӡӡΪӴ壬СΪӡֽСøˮƽʹֱʵִӡ100%Ԥ岽Ϊ
½һĿвһ;
ӴΪޱ߿޿ʽWindowsӡȡôӡֽĴС˳ߴΪӴĳߴ磻
ģֽϣʹprint circle lineȷֺͼΣͼοͼƼͳͼȣɷûҪı
printformɵıӡ
2ʵ
ʵ±Ϊľơ
Աһ1998.12.21

ԱԱְƹ

Ʊˣ
½һĿĿвһMdiform1Form1ϼһǩ±øԡ

ԡNameCaption
Mdiform1mdifrmӡ
Form1frmprint
Grddispgrddisp
Label1lblheadingԱһ
Label2lbldata
Label3lblsigneƱˣ

⣬frmprintBorderstyleΪNoneControlbox ΪFalsecaptionΪա MdichildΪTruemdifrmWindowstateΪMaximizedԴ£
Private Sub MDIFormLoad()
frmprint.Show
End Sub

Private Sub FormDblClick()
frmprint.PrintForm
Unload frmprint
End Sub

Private Sub FormLoad()

RemhighleftsizejiangeԶλ
Dim high, leftsize, jiange,i As Integer,j As Integer
Dim grdhigh As Integer, grdwide As Integer
ֱʾĸߡ
jiange = 100high = 0 grdhigh = 0 grdwide = 0

Rem ȷĴС
Grddisp.Cols = 6 Grddisp.Rows = 7

RemôСΪӡֽ
frmprint.Width = Printer.Width
frmprint.Height = Printer.Height
frmprint.Left = 0frmprint.Top = 0

lblheading.FontSize = 16 lblheading.FontBold = -1
lblheading.Top = 500
lblheading.Left = (frmprint.ScaleWidth
- TextWidth(lblheading.Caption))/2
high = lblheading.Top + TextHeight(lblheading.Caption)

lbldata.Top = high + jiange
lbldata.Caption = Format(Now, "yyyy.mm.dd")
high = lbldata.Top + TextHeight(lbldata.Caption)


ڴ˽иߡпԼ뷽ʽ
For i = 0 To Grddisp.Cols - 1
grdwide = grdwide + Grddisp.ColWidth(i)
+ Screen.TwipsPerPixelX
Next i
For i = 0 To Grddisp.Rows - 1
grdhigh = grdhigh + Grddisp.RowHeight(i)
+ Screen.TwipsPerPixelY
Next i
grdwide = grdwide + Screen.TwipsPerPixelX
grdhigh = grdhigh + Screen.TwipsPerPixelY
Grddisp.Width = grdwideGrddisp.Height = grdhigh
Grddisp.Top = high + jiange * 3
Grddisp.Left=(frmprint.ScaleWidth-Grddisp.Width)/2
lbldata.Left=frmprint.ScaleWidth/2+Grddisp.Width/2
-TextWidth(lbldata.Caption) - 450
high = high + Grddisp.Height + jiange


ڴ˽塢ֺüݵ
lblsign.top=high+jiange
lblsign.Left = frmprint.ScaleWidth / 2 + Grddisp.Width / 2 - TextWidth(lblsign.Caption) - 450

End Sub
ĳڼWindows 3.2Windows 9xµͨVB汾ΪVisual Basic 4.0-32רҵ档
߼飺áʦִ洢ʾȵļ춨 ȵżļ춨
ߵλáǼԼо(100095
ո:1999-02-04
