首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请懂VB的同志进来帮帮忙吧?在以下的代码中写上注释!解决办法

2012-01-12 
请懂VB的同志进来帮帮忙吧?在以下的代码中写上注释!急!!!!!SubTempStampa(sPAsInteger,ePAsInteger)PrnPrv

请懂VB的同志进来帮帮忙吧?在以下的代码中写上注释!急!!!!!
Sub   TempStampa(sP   As   Integer,   eP   As   Integer)

        PrnPrv.MousePointer   =   vbHourglass
        PrnPrn.Command2.Font.Bold   =   True
        DoEvents
       
        PrnPrn.pBar.Width   =   0
       
        Static   DaStampare   As   Boolean
        DaStampare   =   False
        Static   l   As   Integer,   Lung   As   Single,   dX   As   Single,   tmpX   As   Single
        Static   pPnt   As   Integer,   pRef   As   Integer
        pPnt   =   0
        pRef   =   Val(PrnPrv.ePag.Text)
        Static   A   As   String,   B   As   String
        Static   X   As   Single,   Y   As   Single
        Static   X1   As   Single,   Y1   As   Single
        Static   BoxColor   As   Long,   BoxType   As   String
       
        Open   LocPerc   +   LocName   For   Input   As   #26
                While   Not   EOF(26)
                        Line   Input   #26,   A
                        If   A   =   "#line "   Then
                                Line   Input   #26,   A
                                X   =   StripComma(A)
                                Line   Input   #26,   A
                                Y   =   StripComma(A)
                                Line   Input   #26,   A
                                X1   =   StripComma(A)
                                Line   Input   #26,   A
                                Y1   =   StripComma(A)
                                Line   Input   #26,   A
                                B   =   A
                                BoxColor   =   StripComma(A)
                                Line   Input   #26,   A


                                BoxType   =   A
                                If   DaStampare   =   True   Then
                                        If   B   =   " "   And   BoxType   =   " "   Then
                                                Printer.Line   (X,   Y)-(X1,   Y1)
                                        ElseIf   B   <>   " "   Then
                                                Printer.Line   (X,   Y)-(X1,   Y1),   BoxColor,   BF
                                        Else
                                                Printer.Line   (X,   Y)-(X1,   Y1),   ,   B
                                        End   If
                                End   If
                        ElseIf   A   =   "#x "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Printer.CurrentX   =   StripComma(A)
                                End   If
                        ElseIf   A   =   "#y "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Printer.CurrentY   =   StripComma(A)
                                End   If
                        ElseIf   A   =   "#txt_c "   Then


                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        dX   =   Int(Printer.TextWidth(A)   /   2)
                                        tmpX   =   Printer.CurrentX   -   dX
                                        Printer.Print   A
                                End   If
                        ElseIf   A   =   "#txt_l "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Printer.Print   A
                                End   If
                        ElseIf   A   =   "#txt_r "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Lung   =   Printer.TextWidth(A)
                                        Printer.CurrentX   =   Printer.CurrentX   -   Lung
                                        Printer.Print   A
                                End   If
                        ElseIf   A   =   "#fontname "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Printer.FontName   =   A
                                End   If


                        ElseIf   A   =   "#fontsize "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        Printer.FontSize   =   StripComma(A)
                                End   If
                        ElseIf   A   =   "#fontbold "   Then
                                Line   Input   #26,   A
                                If   DaStampare   =   True   Then
                                        If   A   =   "0 "   Then
                                                Printer.FontBold   =   False
                                        Else
                                                Printer.FontBold   =   True
                                        End   If
                                End   If
                        ElseIf   A   =   "#fill "   Then
                                Line   Input   #26,   A
                                If   pPnt   =   pRef   Then
                                        Printer.FillStyle   =   CLng(Val(A))
                                End   If
                        ElseIf   A   =   "#color "   Then
                                Line   Input   #26,   A
                                If   pPnt   =   pRef   Then
                                        Printer.FillColor   =   CLng(Val(A))


                                End   If
                        ElseIf   A   =   "#img "   Then
                                Line   Input   #26,   A
                                If   TempFileExists(A)   =   True   Then
                                        PrnPrv.Img.Picture   =   LoadPicture(A)
                                End   If
                                Line   Input   #26,   A
                                X   =   StripComma(A)
                                Line   Input   #26,   A
                                Y   =   StripComma(A)
                                Line   Input   #26,   A
                                X1   =   StripComma(A)
                                Line   Input   #26,   A
                                Y1   =   StripComma(A)
                                If   DaStampare   =   True   Then
                                        Printer.PaintPicture   PrnPrv.Img.Picture,   X,   Y,   X1,   Y1
                                End   If
                        ElseIf   A   =   "#startpage "   Then
                                If   NM_AnnullaStampa   =   True   Then   GoTo   BastaLeggere
                                pPnt   =   pPnt   +   1
                                If   pPnt   >   eP   Then
                                        GoTo   BastaLeggere
                                ElseIf   pPnt   > =   sP   And   pPnt   <=   eP   Then


                                        DaStampare   =   True
                                        SistemaBarra   sP,   eP,   pPnt
                                        DoEvents
                                ElseIf   pPnt   <   sP   Then
                                        DaStampare   =   False
                                End   If
                        ElseIf   A   =   "#endpage "   Then
                                If   NM_AnnullaStampa   =   True   Then   GoTo   BastaLeggere
                                If   pPnt   > =   eP   Then   GoTo   BastaLeggere
                                If   DaStampare   =   True   Then   Printer.NewPage
                        End   If
                Wend
BastaLeggere:
        Printer.EndDoc
        Close   #26
       
        PrnPrn.Command2.Font.Bold   =   False
        PrnPrv.MousePointer   =   vbDefault
       
End   Sub


[解决办法]
太長了,看了看應該是關於列印的相關內容

热点排行
Bad Request.