Ekli dosya exe.dir
Kaynak kodları:
Public Class Form1
Dim i As Integer = 0
Private Sub D2Button1_Click(sender As System.Object, e As System.EventArgs) Handles D2Button1.Click
Dim ilksayi As Integer = CInt(DAlfabetikTextBox1.Text)
Dim sonsayi As Integer = CInt(DAlfabetikTextBox2.Text)
If CInt(DAlfabetikTextBox1.Text) <= "0" Then
MsgBox("İlk Sayfa Numaralasını Girmediniz")
ElseIf CInt(DAlfabetikTextBox2.Text) <= "0" Then
MsgBox("Son Sayfa Numaralasını Girmediniz")
ElseIf CInt(DAlfabetikTextBox2.Text) < CInt(DAlfabetikTextBox1.Text) Then
MsgBox("Son Sayfa İlk Sayfadan Küçük Olamaz")
Else
Dim pdx As Integer
For pdx = 1 To DComboBox1.Text
Dim pd As New System.Drawing.Printing.PrintDocument
AddHandler pd.PrintPage, AddressOf PrintDocument_PrintPage
pd.Print()
Next
End If
End Sub
Private Sub PrintDocument_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim ilksayi As Integer = CInt(DAlfabetikTextBox1.Text)
Dim sonsayi As Integer = CInt(DAlfabetikTextBox2.Text)
Dim fark As Integer = sonsayi - ilksayi
While i < fark + 1
e.Graphics.DrawString((i + ilksayi).ToString, New Font("Tahoma", 14, FontStyle.Bold), Brushes.Black, e.PageSettings.PaperSize.Width - 73, 20)
i = i + 1
Exit While
End While
If i < fark + 1 Then e.HasMorePages = True Else e.HasMorePages = False : i = 0
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
DComboBox1.Text = "1"
End Sub
Private Sub D1Button1_Click(sender As System.Object, e As System.EventArgs) Handles D1Button1.Click
Application.ExitThread()
End Sub