Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
GeoDem - Form1.vb

Form1.vb

Caricato da: RiccardoG97
Scarica il programma completo

  1. Imports System.IO
  2. Imports System.Drawing.Printing
  3.  
  4. Public Class Form1
  5.  
  6.     Private PrintPageSettings As New PageSettings
  7.     Private IpotesiToPrint As String
  8.     Private TesiToPrint As String
  9.     Private DimostrazioneToPrint As String
  10.     Private PrintTIFont As New Font("Arial", 12)
  11.     Private PrintDIMFont As New Font("Arial", 15)
  12.  
  13.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  14.         cmbSizeMode.SelectedItem = "Normal"
  15.         pbFigura.SizeMode = PictureBoxSizeMode.Normal
  16.     End Sub
  17.  
  18.     Private Sub ProgettToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProgettToolStripMenuItem.Click
  19.  
  20.         If (MsgBox("Sei sicuro? Tutti i dati non salvati andranno perduti!", MsgBoxStyle.YesNo, "Procedere?") = MsgBoxResult.Yes) Then
  21.             txtIpotesi.Text = ""
  22.             txtTesi.Text = ""
  23.             txtDimostrazione.Text = ""
  24.         End If
  25.  
  26.     End Sub
  27.  
  28.     Private Sub IpotesiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles IpotesiToolStripMenuItem.Click
  29.  
  30.         If (MsgBox("Sei sicuro? Tutti i dati non salvati nell'ipotesi andranno perduti!", MsgBoxStyle.YesNo, "Procedere?") = MsgBoxResult.Yes) Then
  31.             txtIpotesi.Text = ""
  32.         End If
  33.  
  34.     End Sub
  35.  
  36.     Private Sub TesiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TesiToolStripMenuItem.Click
  37.  
  38.         If (MsgBox("Sei sicuro? Tutti i dati non salvati nella tesi andranno perduti!", MsgBoxStyle.YesNo, "Procedere?") = MsgBoxResult.Yes) Then
  39.             txtTesi.Text = ""
  40.         End If
  41.  
  42.     End Sub
  43.  
  44.     Private Sub DimostrazioneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DimostrazioneToolStripMenuItem.Click
  45.  
  46.         If (MsgBox("Sei sicuro? Tutti i dati non salvati nella dimostrazione andranno perduti!", MsgBoxStyle.YesNo, "Procedere?") = MsgBoxResult.Yes) Then
  47.             txtDimostrazione.Text = ""
  48.         End If
  49.  
  50.     End Sub
  51.  
  52.     Private Sub FiguraToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles FiguraToolStripMenuItem1.Click
  53.  
  54.         OpenFileDialog2.Filter = "PNG Files (*.png) | *.png | JPEG Files (*.jpg) | *.jpg | BMP Files (*.bmp) | *.bmp"
  55.         If (OpenFileDialog2.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  56.             Try
  57.                 pbFigura.Image = System.Drawing.Image.FromFile(OpenFileDialog2.FileName)
  58.             Catch ex As Exception
  59.                 MsgBox("Il file potrebbe non essere supportato o non esistere più!", MsgBoxStyle.Critical, "Errore!")
  60.             End Try
  61.         End If
  62.     End Sub
  63.  
  64.     Private Sub btnCaricaIMG_Click(sender As System.Object, e As System.EventArgs) Handles btnCaricaIMG.Click
  65.  
  66.         OpenFileDialog2.Filter = "PNG Files (*.png) | *.png | JPEG Files (*.jpg) | *.jpg | BMP Files (*.bmp) | *.bmp"
  67.         If (OpenFileDialog2.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  68.             Try
  69.                 pbFigura.Image = System.Drawing.Image.FromFile(OpenFileDialog2.FileName)
  70.             Catch ex As Exception
  71.                 MsgBox("Il file potrebbe non essere supportato o non esistere più!", MsgBoxStyle.Critical, "Errore!")
  72.             End Try
  73.         End If
  74.     End Sub
  75.  
  76.     Private Sub IpotesiToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles IpotesiToolStripMenuItem1.Click
  77.  
  78.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  79.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  80.             txtIpotesi.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  81.         End If
  82.  
  83.     End Sub
  84.  
  85.     Private Sub btnCaricaHP_Click(sender As System.Object, e As System.EventArgs) Handles btnCaricaHP.Click
  86.  
  87.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  88.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  89.             txtIpotesi.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  90.         End If
  91.  
  92.     End Sub
  93.  
  94.     Private Sub TesiToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles TesiToolStripMenuItem1.Click
  95.  
  96.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  97.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  98.             txtTesi.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  99.         End If
  100.  
  101.     End Sub
  102.  
  103.     Private Sub btnCaricaTH_Click(sender As System.Object, e As System.EventArgs) Handles btnCaricaTH.Click
  104.  
  105.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  106.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  107.             txtTesi.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  108.         End If
  109.  
  110.     End Sub
  111.  
  112.     Private Sub DimostrazioneToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles DimostrazioneToolStripMenuItem1.Click
  113.  
  114.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  115.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  116.             txtDimostrazione.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  117.         End If
  118.  
  119.     End Sub
  120.  
  121.     Private Sub btnCaricaDIM_Click(sender As System.Object, e As System.EventArgs) Handles btnCaricaDIM.Click
  122.  
  123.         OpenFileDialog1.Filter = "Text Files (*.txt) | *.txt"
  124.         If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
  125.             txtDimostrazione.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
  126.         End If
  127.  
  128.     End Sub
  129.  
  130.     Private Sub cmbSizeMode_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbSizeMode.SelectedIndexChanged
  131.         pbFigura.SizeMode = cmbSizeMode.SelectedIndex
  132.     End Sub
  133.  
  134.     Private Sub EsciToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EsciToolStripMenuItem.Click
  135.         End
  136.     End Sub
  137.  
  138.     Private Sub ProgrammaToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProgrammaToolStripMenuItem.Click
  139.         MsgBox("GeoDem (Geometric Demonstrations) è un semplice programma per scrivere, salvare e stampare ordinatamente le tue dimostrazioni geometriche!", MsgBoxStyle.Information, "GeoDem")
  140.     End Sub
  141.  
  142.     Private Sub ProgrammatoreToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProgrammatoreToolStripMenuItem.Click
  143.         MsgBox("GeoDem è stato sviluppato interamente da Riccardo Graziosi", MsgBoxStyle.Information, "Sviluppatore")
  144.     End Sub
  145.  
  146.     Private Sub NonRiescoAVisualizzareLimmagineToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NonRiescoAVisualizzareLimmagineToolStripMenuItem.Click
  147.         MsgBox("GeoDem accetta immagini con le seguenti estensioni: .jpg, .png, .bmp, .gif, .tiff e .tga. Caricare file di testo, file eseguibili etc non è consentito.", MsgBoxStyle.Information, "Non riesco a visualizzare l'immagine")
  148.     End Sub
  149.  
  150.     Private Sub NonRiescoACaricareFileDiTestoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NonRiescoACaricareFileDiTestoToolStripMenuItem.Click
  151.         MsgBox("GeoDem accetta file di testo solo con l'estensione .txt. Caricare file di immagini, file eseguibili o anche documenti di Word non è consentito.", MsgBoxStyle.Information, "Non riesco a caricare file di testo")
  152.     End Sub
  153.  
  154.     Private Sub NonTrovoLeImmaginiAncheSeCiSonoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NonTrovoLeImmaginiAncheSeCiSonoToolStripMenuItem.Click
  155.         MsgBox("Prova a cambiare il filtro, ovvero da .jpg a .bmp o .png. Le immagini potrebbero non essere nel formato standard di GeoDem", MsgBoxStyle.Information, "Non trovo le immagini anche se ci sono")
  156.     End Sub
  157.  
  158.     Private Sub ComeUsareIlProgrammaToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ComeUsareIlProgrammaToolStripMenuItem.Click
  159.         MsgBox("Usare GeoDem è molto semplice, infatti non devi fare altro che risolvere la dimostrazione scrivendo nelle rispettive caselle di testo Ipotesi, Tesi e Dimostrazioni. Puoi anche caricare la figura! Dopo aver finito non ti basta altro che premere Stampa! La tua dimostrazione verrà stampata ordinatamente su un foglio.", MsgBoxStyle.Information, "Come usare il programma")
  160.     End Sub
  161.  
  162.     Private Sub IpotesiToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles IpotesiToolStripMenuItem3.Click
  163.         txtIpotesi.Text += "≡"
  164.     End Sub
  165.  
  166.     Private Sub TesiToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles TesiToolStripMenuItem2.Click
  167.         txtTesi.Text += "≡"
  168.     End Sub
  169.  
  170.     Private Sub DImostrazioneToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles DImostrazioneToolStripMenuItem3.Click
  171.         txtDimostrazione.Text += "≡"
  172.     End Sub
  173.  
  174.     Private Sub IpotesiToolStripMenuItem4_Click(sender As System.Object, e As System.EventArgs) Handles IpotesiToolStripMenuItem4.Click
  175.         txtIpotesi.Text += "≠"
  176.     End Sub
  177.  
  178.     Private Sub TesiToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles TesiToolStripMenuItem3.Click
  179.         txtTesi.Text += "≠"
  180.     End Sub
  181.  
  182.     Private Sub DimostrazioneToolStripMenuItem4_Click(sender As System.Object, e As System.EventArgs) Handles DimostrazioneToolStripMenuItem4.Click
  183.         txtDimostrazione.Text += "≠"
  184.     End Sub
  185.  
  186.     Private Sub PostulatiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PostulatiToolStripMenuItem.Click
  187.         Aiuto.Show()
  188.     End Sub
  189.  
  190.     Private Sub IpotesiToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles IpotesiToolStripMenuItem2.Click
  191.         SaveFileDialog1.Title = "Salva Ipotesi con nome..."
  192.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  193.         SaveFileDialog1.ShowDialog()
  194.         If SaveFileDialog1.FileName <> "" Then
  195.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  196.             PrintLine(1, txtIpotesi.Text)
  197.             FileClose(1)
  198.         End If
  199.     End Sub
  200.  
  201.     Private Sub btnSaveIpotesi_Click(sender As System.Object, e As System.EventArgs) Handles btnSaveIpotesi.Click
  202.         SaveFileDialog1.Title = "Salva Ipotesi con nome..."
  203.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  204.         SaveFileDialog1.ShowDialog()
  205.         If SaveFileDialog1.FileName <> "" Then
  206.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  207.             PrintLine(1, txtIpotesi.Text)
  208.             FileClose(1)
  209.         End If
  210.     End Sub
  211.  
  212.     Private Sub TestiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TestiToolStripMenuItem.Click
  213.         SaveFileDialog1.Title = "Salva Tesi con nome..."
  214.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  215.         SaveFileDialog1.ShowDialog()
  216.         If SaveFileDialog1.FileName <> "" Then
  217.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  218.             PrintLine(1, txtTesi.Text)
  219.             FileClose(1)
  220.         End If
  221.     End Sub
  222.  
  223.     Private Sub btnSaveTesi_Click(sender As System.Object, e As System.EventArgs) Handles btnSaveTesi.Click
  224.         SaveFileDialog1.Title = "Salva Tesi con nome..."
  225.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  226.         SaveFileDialog1.ShowDialog()
  227.         If SaveFileDialog1.FileName <> "" Then
  228.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  229.             PrintLine(1, txtTesi.Text)
  230.             FileClose(1)
  231.         End If
  232.     End Sub
  233.  
  234.     Private Sub DimostrazioneToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles DimostrazioneToolStripMenuItem2.Click
  235.         SaveFileDialog1.Title = "Salva Dimostrazione con nome..."
  236.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  237.         SaveFileDialog1.ShowDialog()
  238.         If SaveFileDialog1.FileName <> "" Then
  239.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  240.             PrintLine(1, txtDimostrazione.Text)
  241.             FileClose(1)
  242.         End If
  243.     End Sub
  244.  
  245.     Private Sub btnSaveDim_Click(sender As System.Object, e As System.EventArgs) Handles btnSaveDim.Click
  246.         SaveFileDialog1.Title = "Salva Dimostrazione con nome..."
  247.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  248.         SaveFileDialog1.ShowDialog()
  249.         If SaveFileDialog1.FileName <> "" Then
  250.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  251.             PrintLine(1, txtDimostrazione.Text)
  252.             FileClose(1)
  253.         End If
  254.     End Sub
  255.  
  256.     Private Sub ProgettoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProgettoToolStripMenuItem.Click
  257.         'Salva Ipotesi
  258.         SaveFileDialog1.Title = "Salva Ipotesi con nome..."
  259.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  260.         SaveFileDialog1.ShowDialog()
  261.         If SaveFileDialog1.FileName <> "" Then
  262.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  263.             PrintLine(1, txtIpotesi.Text)
  264.             FileClose(1)
  265.         End If
  266.  
  267.         'Salva Tesi
  268.         SaveFileDialog1.Title = "Salva Tesi con nome..."
  269.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  270.         SaveFileDialog1.ShowDialog()
  271.         If SaveFileDialog1.FileName <> "" Then
  272.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  273.             PrintLine(1, txtTesi.Text)
  274.             FileClose(1)
  275.         End If
  276.  
  277.         'Salva Dimostrazione
  278.         SaveFileDialog1.Title = "Salva Dimostrazione con nome..."
  279.         SaveFileDialog1.Filter = "Text Files | *.txt | All Files | *.*"
  280.         SaveFileDialog1.ShowDialog()
  281.         If SaveFileDialog1.FileName <> "" Then
  282.             FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
  283.             PrintLine(1, txtDimostrazione.Text)
  284.             FileClose(1)
  285.         End If
  286.     End Sub
  287.  
  288.     Private Sub ColoreToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ColoreToolStripMenuItem.Click
  289.         ColorDialog1.ShowDialog()
  290.         txtIpotesi.SelectionColor = ColorDialog1.Color
  291.         txtTesi.SelectionColor = ColorDialog1.Color
  292.         txtDimostrazione.SelectionColor = ColorDialog1.Color
  293.     End Sub
  294.  
  295.     Private Sub CarattereToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CarattereToolStripMenuItem.Click
  296.         FontDialog1.ShowDialog()
  297.         txtIpotesi.SelectionFont = FontDialog1.Font
  298.         txtTesi.SelectionFont = FontDialog1.Font
  299.         txtDimostrazione.SelectionFont = FontDialog1.Font
  300.     End Sub
  301.  
  302.     Private Sub StampaToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles StampaToolStripMenuItem1.Click
  303.         Try
  304.             PrintDocument1.DefaultPageSettings = PrintPageSettings
  305.             IpotesiToPrint = txtIpotesi.Text
  306.             TesiToPrint = txtTesi.Text
  307.             DimostrazioneToPrint = txtDimostrazione.Text
  308.             PrintDialog1.Document = PrintDocument1
  309.             Dim result As DialogResult = PrintDialog1.ShowDialog()
  310.             If (result = Windows.Forms.DialogResult.OK) Then
  311.                 PrintDocument1.Print()
  312.             End If
  313.         Catch ex As Exception
  314.             MsgBox("Si è verificato un errore imprevisto! Impossibile stampare la dimostrazione!", MsgBoxStyle.Critical, "Errore!")
  315.         End Try
  316.     End Sub
  317.  
  318.     Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
  319.         e.Graphics.PageUnit = GraphicsUnit.Millimeter
  320.  
  321.         Dim numChars As Integer
  322.         Dim numLines As Integer
  323.         Dim stringForPageIPO As String
  324.         Dim stringForPageTESI As String
  325.         Dim stringForPageDIM As String
  326.         Dim strFormat As New StringFormat
  327.  
  328.         'FIGURA
  329.         Dim FiguraTITRect As New RectangleF(10, 5, 115, 95)
  330.         Dim FiguraRect As New RectangleF(10, 15, 115, 95)
  331.         e.Graphics.DrawString(lblFigura.Text, lblFigura.Font, Brushes.Red, FiguraTITRect, strFormat)
  332.         e.Graphics.DrawImage(Image.FromFile(OpenFileDialog2.FileName), FiguraRect)
  333.         e.HasMorePages = False
  334.  
  335.         'IPOTESI
  336.         Dim IpotesiTITRect As New RectangleF(134, 5, 70, 65)
  337.         Dim IpotesiRect As New RectangleF(134, 15, 70, 65)
  338.         Dim sizeMeasureIpotesi As New SizeF(70, 65 - PrintTIFont.GetHeight(e.Graphics))
  339.         strFormat.Trimming = StringTrimming.Word
  340.         e.Graphics.MeasureString(IpotesiToPrint, PrintTIFont, sizeMeasureIpotesi, strFormat, numChars, numLines)
  341.         stringForPageIPO = IpotesiToPrint.Substring(0, numChars)
  342.         e.Graphics.DrawString(lblIpotesi.Text, lblIpotesi.Font, Brushes.Red, IpotesiTITRect, strFormat)
  343.         e.Graphics.DrawString(stringForPageIPO, PrintTIFont, Brushes.Black, IpotesiRect, strFormat)
  344.  
  345.         If (numChars < IpotesiToPrint.Length) Then
  346.             IpotesiToPrint = IpotesiToPrint.Substring(numChars)
  347.             e.HasMorePages = True
  348.         Else
  349.             e.HasMorePages = False
  350.             IpotesiToPrint = txtIpotesi.Text
  351.         End If
  352.  
  353.         'TESI
  354.         Dim tesiTITRect As New RectangleF(134, 80, 70, 25)
  355.         Dim TesiRect As New RectangleF(134, 90, 70, 25)
  356.         Dim sizeMeasureTesi As New SizeF(70, 25 - PrintTIFont.GetHeight(e.Graphics))
  357.         strFormat.Trimming = StringTrimming.Word
  358.         e.Graphics.MeasureString(TesiToPrint, PrintTIFont, sizeMeasureTesi, strFormat, numChars, numLines)
  359.         stringForPageTESI = TesiToPrint.Substring(0, numChars)
  360.         e.Graphics.DrawString(lblTesi.Text, lblTesi.Font, Brushes.Red, tesiTITRect, strFormat)
  361.         e.Graphics.DrawString(stringForPageTESI, PrintTIFont, Brushes.Black, TesiRect, strFormat)
  362.  
  363.         If (numChars < TesiToPrint.Length) Then
  364.             TesiToPrint = TesiToPrint.Substring(numChars)
  365.             e.HasMorePages = True
  366.         Else
  367.             e.HasMorePages = False
  368.             TesiToPrint = txtTesi.Text
  369.         End If
  370.  
  371.         'DIMOSTRAZIONE
  372.         Dim DimostrazioneTITRect As New RectangleF(10, 115, 190, 170)
  373.         Dim DimostrazioneRect As New RectangleF(10, 125, 190, 170)
  374.         Dim sizeMeasureDimostrazione As New SizeF(190, 180 - PrintDIMFont.GetHeight(e.Graphics))
  375.         strFormat.Trimming = StringTrimming.Word
  376.         e.Graphics.MeasureString(DimostrazioneToPrint, PrintDIMFont, sizeMeasureDimostrazione, strFormat, numChars, numLines)
  377.         stringForPageDIM = DimostrazioneToPrint.Substring(0, numChars)
  378.         e.Graphics.DrawString(lblDimostrazione.Text, lblDimostrazione.Font, Brushes.Red, DimostrazioneTITRect, strFormat)
  379.         e.Graphics.DrawString(stringForPageDIM, PrintDIMFont, Brushes.Black, DimostrazioneRect, strFormat)
  380.  
  381.         If (numChars < DimostrazioneToPrint.Length) Then
  382.             DimostrazioneToPrint = DimostrazioneToPrint.Substring(numChars)
  383.             e.HasMorePages = True
  384.         Else
  385.             e.HasMorePages = False
  386.             DimostrazioneToPrint = txtDimostrazione.Text
  387.         End If
  388.  
  389.     End Sub
  390.  
  391. End Class