Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

kako da ukljucim multiline kod printera?

[es] :: Visual Basic 6 :: kako da ukljucim multiline kod printera?

[ Pregleda: 4581 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

#404

Član broj: 447
Poruke: 10
*.dialup.blic.net



Profil

icon kako da ukljucim multiline kod printera?27.10.2001. u 21:44 - pre 273 meseci
printer se ponasa kao textbox sa propertijem multiline podesenim na false.
kad printa odredjeni tekst, ne zna preci u novi red kad dodje do kraja
linije. procitao sam u msdn-u sve o printanju, pa sam pokusavao ispetljati
nesto sa propertijima scalewidth, textwidth, width, itd, i dzaba, samo su mi
oci zakrvavile.. zato pomagajte dobri ljudi, prije nego sto se objesim medju
sunkama..



Code:
        Printer.Print ""
        Printer.FontName = "Arial"
        Printer.FontSize = 22
        Printer.FontBold = False
        Printer.Print Text1.Text
        Printer.EndDoc


Marko_L : Dodati code tagovi


[Ovu poruku je menjao Marko_L dana 18.06.2005. u 00:09 GMT+1]
 
Odgovor na temu

gio1000
Italia

Član broj: 1159
Poruke: 122
*.98-62.inwind.it



Profil

icon Re: kako da ukljucim multiline kod printera?28.10.2001. u 05:49 - pre 273 meseci
Nadam se da je to sto ti treba.

Code:
Private Sub PrintTextBox(ByRef cControl As TextBox)
Dim CurrentLeft     As Single
Dim iCurrPos        As Integer
Dim iLenght         As Integer

With cControl 'Inizio WITH cControl.
    Let CurrentLeft = .Left 
    Printer.CurrentY = .Top 
    Printer.CurrentX = CurrentLeft 
    Printer.FontName = .FontName 
    Printer.FontBold = .FontBold 
    Printer.FontItalic = .FontItalic 
    Printer.FontUnderline = .FontUnderline 
    Printer.FontSize = .FontSize 
    Let iLenght = 0 
    Do While iLenght < Len(.Text) 
        Let iLenght = iLenght + 1 
        If InStr(iLenght, .Text, vbNewLine) <> 0 Then 
            Let iCurrPos = InStr(iLenght, .Text, vbNewLine, vbTextCompare) 
            Printer.CurrentX = CurrentLeft 
            Printer.Print Mid(.Text, iLenght + IIf(iLenght = 1, 0, 1), IIf(iLenght = 1, iCurrPos - iLenght, iCurrPos - iLenght - 1))
            Let iLenght = iCurrPos 
        Else 
            Let iCurrPos = Len(.Text) 
            Printer.CurrentX = CurrentLeft 
            Printer.Print Mid(.Text, IIf(iLenght = 1, iLenght, iLenght + 1), iCurrPos)
            Exit Do 
        End If 
    Loop 
End With 

Printer.EndDoc 
End Sub


Private Sub Command1_Click()
    PrintTextBox Text1
End Sub


Marko_L : Dodati code tagovi
 
Odgovor na temu

[es] :: Visual Basic 6 :: kako da ukljucim multiline kod printera?

[ Pregleda: 4581 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.