Click here to Skip to main content
15,916,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralCustom ComboBox Problem Pin
Jason Stamp23-Feb-05 3:56
Jason Stamp23-Feb-05 3:56 
GeneralRe: Custom ComboBox Problem Pin
j45mw12-Mar-05 17:39
j45mw12-Mar-05 17:39 
GeneralDatagrind i win applications Pin
Member 31636123-Feb-05 2:33
Member 31636123-Feb-05 2:33 
GeneralRe: Datagrind i win applications Pin
Jim Matthews23-Feb-05 3:36
Jim Matthews23-Feb-05 3:36 
QuestionHow to print a grid Pin
pdcoope23-Feb-05 2:21
pdcoope23-Feb-05 2:21 
AnswerRe: How to print a grid Pin
Dave Kreskowiak23-Feb-05 4:18
mveDave Kreskowiak23-Feb-05 4:18 
GeneralRe: How to print a grid Pin
Anonymous23-Feb-05 7:05
Anonymous23-Feb-05 7:05 
AnswerRe: How to print a grid Pin
Just Greeky Creek23-Feb-05 4:35
Just Greeky Creek23-Feb-05 4:35 
Try this

    Dim ActivePageNumber As Short = 1<br />
    Dim pageCount As Short = 0<br />
    Dim ItemCountOnPerPage As Integer = 30<br />
    Dim dtSource As DataTable<br />
    Dim index As Short<br />
    Private Sub btnPrintDataGrid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrintDataGrid.Click<br />
        ActivePageNumber = 1<br />
        pageCount = Math.Ceiling(dtSource.Rows.Count / ItemCountOnPerPage)<br />
        PrintDocument1.Print()<br />
    End Sub<br />
<br />
<br />
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage<br />
        If Not ActivePageNumber > pageCount Then<br />
            PrintDataTable(e.Graphics)<br />
            ActivePageNumber += 1<br />
            e.HasMorePages = True<br />
        Else<br />
            e.HasMorePages = False<br />
        End If<br />
    End Sub<br />
<br />
    Public Sub PrintDataTable(ByVal e As Graphics)<br />
        Dim x, y As Short<br />
        Dim fArial As New Font("Arial", 8)<br />
        x = 20<br />
        y = 20<br />
        Dim cci As Short = index<br />
        Do While (cci <> ItemCountOnPerPage Or index <> dtSource.Rows.Count - 1)<br />
            For columnIndex As Short = 0 To dtSource.Columns.Count - 1<br />
                e.DrawString(dtSource.Rows(index)(columnIndex), fArial, New SolidBrush(Color.Black), x, y)<br />
                x += 30 '  set this to column width<br />
            Next<br />
            y += fArial.Height<br />
            cci += 1<br />
            index += 1<br />
        Loop<br />
    End Sub

GeneralRe: How to print a grid Pin
Anonymous23-Feb-05 7:06
Anonymous23-Feb-05 7:06 
GeneralAudio mute Pin
sneffe123-Feb-05 2:02
sneffe123-Feb-05 2:02 
GeneralRe: Audio mute Pin
Dave Kreskowiak23-Feb-05 4:08
mveDave Kreskowiak23-Feb-05 4:08 
GeneralPop up menu Pin
Anonymous23-Feb-05 1:34
Anonymous23-Feb-05 1:34 
GeneralRe: Pop up menu Pin
Dave Kreskowiak23-Feb-05 3:56
mveDave Kreskowiak23-Feb-05 3:56 
GeneralApp.config Pin
nitin_ion23-Feb-05 1:14
nitin_ion23-Feb-05 1:14 
GeneralRe: App.config Pin
Dave Kreskowiak23-Feb-05 3:30
mveDave Kreskowiak23-Feb-05 3:30 
QuestionHow can I access a class written in C++ in a VB project?? Pin
Logan from Singapore22-Feb-05 22:59
Logan from Singapore22-Feb-05 22:59 
AnswerRe: How can I access a class written in C++ in a VB project?? Pin
Dave Kreskowiak23-Feb-05 0:41
mveDave Kreskowiak23-Feb-05 0:41 
Generalproblems impleminting ListView.ListViewItemCollection.Contains Pin
ASDEF000122-Feb-05 19:36
ASDEF000122-Feb-05 19:36 
Generalwell in order to solve the problem i used IEnumorator Pin
ASDEF000122-Feb-05 21:29
ASDEF000122-Feb-05 21:29 
QuestionHow to convert a htm page to asp page Pin
GoldenStar22-Feb-05 14:34
GoldenStar22-Feb-05 14:34 
AnswerRe: How to convert a htm page to asp page Pin
Christian Graus22-Feb-05 14:49
protectorChristian Graus22-Feb-05 14:49 
GeneralRe: How to convert a htm page to asp page Pin
GoldenStar22-Feb-05 15:40
GoldenStar22-Feb-05 15:40 
GeneralContext menu in different listviews Pin
22-Feb-05 11:00
suss22-Feb-05 11:00 
GeneralDifference between CreateObject and New method Pin
Mahesh167922-Feb-05 8:26
Mahesh167922-Feb-05 8:26 
GeneralRe: Difference between CreateObject and New method Pin
Christian Graus22-Feb-05 8:47
protectorChristian Graus22-Feb-05 8:47 

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.