Click here to Skip to main content
15,890,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionEvents Pin
jkirkerx30-Nov-14 9:35
professionaljkirkerx30-Nov-14 9:35 
QuestionHelp for code in vb.net Pin
Member 1127214729-Nov-14 16:21
Member 1127214729-Nov-14 16:21 
SuggestionRe: Help for code in vb.net Pin
Richard MacCutchan29-Nov-14 23:26
mveRichard MacCutchan29-Nov-14 23:26 
Questionwordwrap on datagridtextboxcolumn Pin
Member 1126800728-Nov-14 16:39
Member 1126800728-Nov-14 16:39 
QuestionHow can I convert the VBA OCT() function in to a VB .NET function Pin
Stephen Holdorf28-Nov-14 5:17
Stephen Holdorf28-Nov-14 5:17 
AnswerRe: How can I convert the VBA OCT() function in to a VB .NET function Pin
Richard MacCutchan28-Nov-14 5:56
mveRichard MacCutchan28-Nov-14 5:56 
AnswerRe: How can I convert the VBA OCT() function in to a VB .NET function Pin
Richard Deeming28-Nov-14 8:12
mveRichard Deeming28-Nov-14 8:12 
Questiondrawline Pin
JR21227-Nov-14 20:29
JR21227-Nov-14 20:29 
Hi,

I wrote a program for competition.
when I print at home I get a good result left on the Picture[^]
When I print at work. I have the result at the right site.

What do I wrong?
Here is the code.
VB
Public Sub sPrnEmptyTabel(ByVal Personen As Int16, ByVal e As System.Drawing.Printing.PrintPageEventArgs, ByVal StartY As Int16)
    Dim g As Graphics = e.Graphics
    Dim nLijnLengte, nX As Integer
    Dim n1CharX = g.MeasureString("A", Me.Font).Width
    Dim n1CharY = Me.Font.Height
    nLijnLengte = Personen * nAfstand + nNaamBreedte + 3 * nPuntBreedte + nVoorsprongBreedte
    For nY As Integer = 1 To Personen
        g.DrawLine(New Pen(Color.Black), 0, StartY + nNaamBreedte + (nY - 1) * nAfstand, nLijnLengte, StartY + nNaamBreedte + (nY - 1) * nAfstand) 'horizontale lijnen

        g.DrawLine(New Pen(Color.Black), nNaamBreedte + (nY - 1) * nAfstand, StartY, nNaamBreedte + (nY - 1) * nAfstand, StartY + nNaamBreedte + (Personen) * nAfstand) 'vertikale lijnen
        For nX = 1 To Personen
            If nY = nX Then
                g.FillRectangle(Brushes.Red, nNaamBreedte + nAfstand * (nX - 1), StartY + nNaamBreedte + (nY - 1) * nAfstand, nAfstand, nAfstand)
                g.DrawString("*", New Font(Me.Font.Name, 20), Brushes.White, nNaamBreedte + nAfstand * (nX - 1), StartY + nNaamBreedte + (nY - 1) * nAfstand)
            Else
                Dim x1, x2, y1, y2 As Integer
                x1 = nNaamBreedte + nAfstand * (nX - 1)
                y1 = StartY + nNaamBreedte + (nY - 1) * nAfstand
                x2 = x1 + nAfstand
                y2 = y1 + nAfstand
                g.DrawLine(Pens.Green, x2 - 5, y1 + 5, x1 + 5, y2 - 5)
            End If
        Next nX
        g.DrawLine(New Pen(Color.Black), nNaamBreedte + (nY) * nAfstand, StartY, nNaamBreedte + (nY) * nAfstand, StartY + nNaamBreedte + (Personen) * nAfstand) 'vertikale lijnen
    Next nY

    g.DrawLine(New Pen(Color.Black), 0, StartY + nNaamBreedte + (Personen) * nAfstand, nLijnLengte, StartY + nNaamBreedte + Personen * nAfstand) 'horizontale eindlijn

    For n As Integer = 1 To 4
        g.DrawLine(New Pen(Color.Black), nNaamBreedte + (Personen) * nAfstand + n * nPuntBreedte, StartY + 0, nNaamBreedte + (Personen) * nAfstand + n * nPuntBreedte, StartY + nNaamBreedte + (Personen) * nAfstand)       'lijn voor de som vd punten
    Next
    With g
        .TranslateTransform(0.0F, nNaamBreedte)
        .RotateTransform(270)
        Dim a As New List(Of String)
        a.Add(LangSet.Table.tblWhite)
        a.Add(LangSet.Table.tblBlack)
        a.Add(LangSet.Table.tblGames)
        a.Add(LangSet.Table.tblTotal)
        For X As Integer = 0 To 3
            Dim sKopTekst = " " & a(X)
            g.DrawString(sKopTekst, New Font(Me.Font, FontStyle.Regular), Brushes.Black, -StartY, nNaamBreedte + (Personen + 3) * nAfstand + (X - 1) * nPuntBreedte)
        Next
        .RotateTransform(-270)
        .TranslateTransform(0.0F, -nNaamBreedte)
        sCopyRight(e, fGetResInfo("Titel1") & " " & fGetResInfo("Titel2"))
    End With
End Sub

The code is called from a printdoc

Jan
AnswerRe: drawline Pin
Eddy Vluggen28-Nov-14 7:55
professionalEddy Vluggen28-Nov-14 7:55 
GeneralRe: drawline Pin
JR21228-Nov-14 18:11
JR21228-Nov-14 18:11 
GeneralRe: drawline Pin
Eddy Vluggen30-Nov-14 4:44
professionalEddy Vluggen30-Nov-14 4:44 
GeneralRe: drawline Pin
JR2122-Dec-14 20:45
JR2122-Dec-14 20:45 
QuestionApplication Software with Online Database Pin
akashangel26-Nov-14 18:39
akashangel26-Nov-14 18:39 
AnswerRe: Application Software with Online Database Pin
Richard MacCutchan26-Nov-14 20:40
mveRichard MacCutchan26-Nov-14 20:40 
AnswerRe: Application Software with Online Database Pin
Bernhard Hiller27-Nov-14 0:36
Bernhard Hiller27-Nov-14 0:36 
QuestionDeserialize Json and store values Pin
jkirkerx26-Nov-14 6:56
professionaljkirkerx26-Nov-14 6:56 
AnswerRe: Deserialize Json and store values Pin
Eddy Vluggen26-Nov-14 8:09
professionalEddy Vluggen26-Nov-14 8:09 
GeneralRe: Deserialize Json and store values Pin
jkirkerx26-Nov-14 8:44
professionaljkirkerx26-Nov-14 8:44 
AnswerRe: Deserialize Json and store values Pin
Richard Deeming26-Nov-14 8:20
mveRichard Deeming26-Nov-14 8:20 
GeneralRe: Deserialize Json and store values [Solved] Pin
jkirkerx26-Nov-14 8:43
professionaljkirkerx26-Nov-14 8:43 
QuestionDrag drop multiple rows between datagrids Pin
tommydk26-Nov-14 1:09
tommydk26-Nov-14 1:09 
AnswerRe: Drag drop multiple rows between datagrids Pin
Eddy Vluggen26-Nov-14 8:12
professionalEddy Vluggen26-Nov-14 8:12 
GeneralRe: Drag drop multiple rows between datagrids Pin
tommydk27-Nov-14 7:55
tommydk27-Nov-14 7:55 
GeneralRe: Drag drop multiple rows between datagrids Pin
Eddy Vluggen28-Nov-14 5:26
professionalEddy Vluggen28-Nov-14 5:26 
GeneralRe: Drag drop multiple rows between datagrids Pin
tommydk29-Nov-14 6:19
tommydk29-Nov-14 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.