亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? datagridprinter.vb

?? TaskVision 應用程序展示了用于個人和公司相關任務管理的一個完整的 n 層應用程序。該示例附帶了用于運行某個私有任務服務器應用程序的隨時可運行的示范客戶端、全部客戶端源代碼
?? VB
字號:
Imports System.Drawing.Printing

Public Class DataGridPrinter

    Public RowCount As Integer = 0
    Public PageNumber As Integer = 1

    Private m_DataTable As DataTable
    Private m_DataGrid As DataGrid
    Private m_ImageArray(2) As Image

    Private m_PageWidth As Integer
    Private m_PageWidthMinusMargins As Integer
    Private m_PageHeight As Integer
    Private m_AdjColumnBy As Integer
    Private m_IsTooWide As Boolean
    Private m_DataGridWidth As Integer

    Private Const c_TopMargin As Integer = 50
    Private Const c_BottomMargin As Integer = 50
    Private Const c_LeftMargin As Integer = 50
    Private Const c_RightMargin As Integer = 50
    Private Const c_VerticalCellLeeway As Integer = 10

    Public Sub New(ByVal dg As DataGrid, ByVal pd As PrintDocument, ByVal dt As DataTable)
        m_DataGrid = dg
        m_DataTable = dt

        'set the document as landscape
        pd.DefaultPageSettings.Landscape = True

        'extract our width and height values
        m_PageHeight = pd.DefaultPageSettings.PaperSize.Width
        m_PageWidth = pd.DefaultPageSettings.PaperSize.Height
        m_PageWidthMinusMargins = m_PageWidth - (c_LeftMargin + c_RightMargin)

        'hard-coded images
        m_ImageArray(0) = Image.FromFile("images/major.gif")
        m_ImageArray(1) = Image.FromFile("images/medium.gif")
        m_ImageArray(2) = Image.FromFile("images/minor.gif")

        m_DataGridWidth = GetDataGridWidth()

        'set up some adjustments to scale the output later
        If m_DataGrid.Width > m_PageWidthMinusMargins Then
            m_AdjColumnBy = m_DataGrid.Width - m_PageWidthMinusMargins
            m_DataGridWidth = m_DataGridWidth - m_AdjColumnBy
            m_IsTooWide = True
        Else
            m_AdjColumnBy = m_PageWidthMinusMargins - m_DataGrid.Width
            m_DataGridWidth = m_DataGridWidth + m_AdjColumnBy
            m_IsTooWide = False
        End If
    End Sub

    Public Function DrawDataGrid(ByVal g As Graphics) As Boolean
        Try
            DrawPageHeader(g)
            Return DrawPageRows(g)
        Catch ex As Exception
            MessageBox.Show(ex.Message.ToString())
            Return False
        End Try
    End Function

    Private Sub DrawPageHeader(ByVal g As Graphics)
        'create the header rectangle
        Dim headerBounds As New RectangleF(c_LeftMargin, c_TopMargin, m_PageWidthMinusMargins, m_DataGrid.HeaderFont.SizeInPoints + c_VerticalCellLeeway)

        'draw the header rectangle
        g.FillRectangle(New SolidBrush(m_DataGrid.HeaderBackColor), headerBounds)

        Dim xPosition As Single = c_LeftMargin + 12 ' +12 for some padding

        'use this format when drawing later
        Dim cellFormat As New StringFormat()
        cellFormat.Trimming = StringTrimming.Word
        cellFormat.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.LineLimit

        'find the column names from the tablestyle
        Dim cs As DataGridColumnStyle
        For Each cs In m_DataGrid.TableStyles(0).GridColumnStyles
            If cs.Width > 0 Then

                'temp width to draw this column
                Dim columnWidth As Integer = cs.Width

                'scale the summary column width
                'note: just a quick way to fit the text to the page width
                'this is not the best way to do this but it handles the most
                'common ui path for this demo app
                If cs.MappingName = "TaskSummary" And m_IsTooWide Then
                    columnWidth -= m_AdjColumnBy
                ElseIf cs.MappingName = "TaskSummary" Then
                    columnWidth += m_AdjColumnBy
                End If

                'create a layout rectangle to draw within.
                Dim cellBounds As New RectangleF(xPosition, c_TopMargin, columnWidth, m_DataGrid.HeaderFont.SizeInPoints + c_VerticalCellLeeway)

                'draw the column name
                g.DrawString(cs.HeaderText, m_DataGrid.HeaderFont, New SolidBrush(m_DataGrid.HeaderForeColor), cellBounds, cellFormat)

                'adjust the next X Pos
                xPosition += columnWidth
            End If
        Next
    End Sub

    Private Function DrawPageRows(ByVal g As Graphics) As Boolean

        Dim yPosition As Single = c_TopMargin + m_DataGrid.HeaderFont.SizeInPoints + (c_VerticalCellLeeway * 2)

        'use this format when drawing later
        Dim cellFormat As New StringFormat()
        cellFormat.Trimming = StringTrimming.Word
        cellFormat.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.LineLimit

        'loop each visible row
        Dim i As Integer = 0
        For i = RowCount To (m_DataTable.DefaultView.Count - 1)

            Dim xPosition As Single = c_LeftMargin + 12 ' +12 for some padding

            'loop the columns of this row, if the column is visible
            'then print the cell value
            Dim cs As DataGridColumnStyle
            For Each cs In m_DataGrid.TableStyles(0).GridColumnStyles
                If cs.Width > 0 Then

                    'temp width to draw this column
                    Dim columnWidth As Integer = cs.Width

                    'scale the summary column width
                    'note: just a quick way to fit the text to the page width
                    'this is not the best way to do this but it handles the most
                    'common ui path for this demo app
                    If cs.MappingName = "TaskSummary" And m_IsTooWide Then
                        columnWidth -= m_AdjColumnBy
                    ElseIf cs.MappingName = "TaskSummary" Then
                        columnWidth += m_AdjColumnBy
                    End If

                    'create a layout rectangle to draw within.
                    Dim cellBounds As New RectangleF(xPosition, yPosition, columnWidth, m_DataGrid.Font.SizeInPoints + c_VerticalCellLeeway)

                    'draw the item value
                    If cs.MappingName = "PriorityText" Then
                        'draw image
                        Select Case m_DataTable.DefaultView.Item(i).Item("PriorityText")
                            Case "Major"
                                g.DrawImage(m_ImageArray(0), New Point(Convert.ToInt32(cellBounds.X) - 5, Convert.ToInt32(cellBounds.Y)))
                            Case "Medium"
                                g.DrawImage(m_ImageArray(1), New Point(Convert.ToInt32(cellBounds.X) - 5, Convert.ToInt32(cellBounds.Y)))
                            Case "Minor"
                                g.DrawImage(m_ImageArray(2), New Point(Convert.ToInt32(cellBounds.X) - 5, Convert.ToInt32(cellBounds.Y)))
                        End Select
                    Else
                        'draw as short date format or regular string
                        If m_DataTable.DefaultView.Item(i).Item(cs.MappingName).GetType() Is GetType(DateTime) Then
                            g.DrawString(String.Format("{0:d}", m_DataTable.DefaultView.Item(i).Item(cs.MappingName)), m_DataGrid.Font, New SolidBrush(m_DataGrid.HeaderForeColor), cellBounds, cellFormat)
                        Else
                            g.DrawString(CType(m_DataTable.DefaultView.Item(i).Item(cs.MappingName), String), m_DataGrid.Font, New SolidBrush(m_DataGrid.HeaderForeColor), cellBounds, cellFormat)
                        End If
                    End If

                    'adjust the next X Pos
                    xPosition += columnWidth
                End If
            Next

            'set the rowcount (which is used for a possible next page)
            RowCount += 1

            'finished with this row, draw a nice line
            g.DrawLine(New Pen(m_DataGrid.GridLineColor, 1), c_LeftMargin, yPosition + m_DataGrid.HeaderFont.SizeInPoints + c_VerticalCellLeeway - 2, m_PageWidthMinusMargins + c_LeftMargin, yPosition + m_DataGrid.HeaderFont.SizeInPoints + c_VerticalCellLeeway - 1)

            'adjust the next Y Pos
            yPosition += m_DataGrid.HeaderFont.SizeInPoints + c_VerticalCellLeeway + 3

            'if at end of page exit out for next page
            If yPosition * PageNumber > PageNumber * (m_PageHeight - (c_BottomMargin + c_TopMargin)) Then
                Return True
            End If
        Next

        Return False
    End Function

    Private Function GetDataGridWidth() As Integer
        Try
            Dim cs As DataGridColumnStyle
            Dim dgWidth As Integer = 0
            For Each cs In m_DataGrid.TableStyles(0).GridColumnStyles
                If cs.Width <> 0 Then
                    dgWidth = dgWidth + cs.Width
                End If
            Next
            Return dgWidth
        Catch ex As Exception
            LogError.Write(ex.Message & vbNewLine & ex.StackTrace)
            Throw ex
        End Try
    End Function
End Class

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影片第一页| 精品美女在线观看| 中文字幕在线观看一区| va亚洲va日韩不卡在线观看| 亚洲午夜免费视频| 国产盗摄精品一区二区三区在线| 久久精品日产第一区二区三区高清版 | 欧美在线观看视频一区二区 | 亚洲第一福利一区| 色激情天天射综合网| 蜜桃视频一区二区| 午夜免费久久看| 亚洲午夜在线视频| 热久久免费视频| 亚洲乱码日产精品bd| 久久一区二区三区四区| 欧美精品日韩综合在线| www.成人网.com| 欧美日韩在线一区二区| 91精品福利视频| 欧美不卡一区二区三区四区| 中文字幕精品一区二区精品绿巨人 | 久久毛片高清国产| 日韩影院在线观看| a4yy欧美一区二区三区| 欧美主播一区二区三区美女| 欧美大片在线观看| 在线播放视频一区| 亚洲色图欧美偷拍| 依依成人精品视频| 中文字幕在线不卡一区二区三区| 亚洲一区二区三区小说| 悠悠色在线精品| 粉嫩aⅴ一区二区三区四区| 日韩一区二区免费在线观看| 欧美在线看片a免费观看| 欧美国产丝袜视频| 国产福利一区二区三区在线视频| 欧美福利一区二区| 午夜精品福利在线| 欧美色综合久久| 亚洲国产精品久久人人爱| 成人av午夜电影| 精品视频1区2区3区| 亚洲国产日韩av| 欧美日韩不卡一区| 欧美精品一区二区三区高清aⅴ| 99精品一区二区三区| 国内精品久久久久影院色| 波多野结衣中文一区| 中文字幕中文字幕在线一区 | 亚洲人成网站色在线观看| 一个色综合网站| 粉嫩欧美一区二区三区高清影视| 国产亚洲欧美一区在线观看| 粉嫩av一区二区三区| 亚洲美女屁股眼交3| 欧美精品日韩综合在线| 国内外精品视频| 亚洲黄色在线视频| 欧美精品xxxxbbbb| 欧美一卡二卡三卡| 色婷婷激情久久| 欧美日韩一级二级| 日韩av中文字幕一区二区| 99久久婷婷国产综合精品| 亚洲国产中文字幕| 久久久久久电影| 91精品国产91久久久久久一区二区| 欧美电视剧免费观看| 成人avav影音| 久久精品国产精品亚洲红杏| 欧美视频在线观看一区二区| 国产在线播放一区| 26uuu久久天堂性欧美| 91福利小视频| 成人app软件下载大全免费| 欧美aⅴ一区二区三区视频| 国产精品久久久久久妇女6080| 欧美精品777| 777精品伊人久久久久大香线蕉| 一区二区三区四区不卡视频| 2欧美一区二区三区在线观看视频| 欧美狂野另类xxxxoooo| 色爱区综合激月婷婷| 成人污视频在线观看| 亚洲欧美视频一区| 亚洲色大成网站www久久九九| 欧美国产欧美综合| 亚洲欧洲日韩女同| 亚洲精品国产无天堂网2021 | 2017欧美狠狠色| 久久亚洲欧美国产精品乐播| 精品国产一二三区| 国产日韩欧美综合一区| 91在线云播放| 欧美伊人久久久久久久久影院| 欧美亚洲国产一卡| 日韩视频123| 国产精品婷婷午夜在线观看| 欧美精品亚洲二区| 久久婷婷综合激情| 亚洲一区二区精品视频| 日本大胆欧美人术艺术动态| 国产一本一道久久香蕉| 91丨国产丨九色丨pron| 粉嫩在线一区二区三区视频| 在线观看一区不卡| 欧美精品一区二区在线观看| 中文字幕在线一区| 日本成人在线电影网| 99视频超级精品| 日韩你懂的电影在线观看| 国产精品久久久久久久第一福利| 日韩精品一二三区| 国产毛片一区二区| 欧美日韩国产乱码电影| 午夜电影一区二区| 日韩三级免费观看| 91在线观看一区二区| 一本高清dvd不卡在线观看| 91麻豆精品国产无毒不卡在线观看| 精品卡一卡二卡三卡四在线| 欧美韩日一区二区三区| 肉色丝袜一区二区| 成人国产亚洲欧美成人综合网| 欧美精品在欧美一区二区少妇| 日韩精品专区在线影院观看 | 蜜臀va亚洲va欧美va天堂| 秋霞午夜av一区二区三区| 色88888久久久久久影院按摩| 久久无码av三级| 亚洲免费观看高清完整版在线| 亚洲第一狼人社区| 欧美三级中文字| 一区二区三区丝袜| 91在线视频播放| 精品国产自在久精品国产| 亚洲成人精品一区| 欧美影片第一页| 国产精品人妖ts系列视频| 精品一区二区国语对白| 欧美电影免费观看高清完整版在| 亚洲不卡一区二区三区| 欧美日韩亚洲综合一区二区三区| 国产丝袜欧美中文另类| 懂色av中文一区二区三区| 国产精品天干天干在观线| 岛国一区二区在线观看| 精品欧美一区二区在线观看| 另类小说欧美激情| 欧美精品一区二区三区在线 | 亚洲第一福利视频在线| 欧美日韩三级在线| 理论电影国产精品| 国产精品毛片高清在线完整版| 国产99精品在线观看| 一级中文字幕一区二区| 欧美三区在线视频| 国产成人亚洲精品狼色在线| 国产精品电影一区二区| 色av综合在线| 国产精品一区二区免费不卡| 国产欧美精品一区二区色综合| 在线日韩av片| 国产成人av一区| 美女一区二区三区| 亚洲欧美视频在线观看| 欧美日韩国产高清一区二区三区 | 亚洲卡通欧美制服中文| 日韩欧美激情在线| 成人小视频免费在线观看| 亚洲成av人在线观看| 精品国产91乱码一区二区三区| k8久久久一区二区三区| 美腿丝袜一区二区三区| 一区二区视频在线看| 日本一区二区三级电影在线观看 | 色综合中文字幕国产| 国产成人综合在线观看| 韩日av一区二区| 麻豆免费看一区二区三区| 亚洲午夜久久久久久久久电影网 | 国产午夜亚洲精品理论片色戒 | 色噜噜狠狠色综合欧洲selulu| 韩国视频一区二区| 狠狠色综合日日| 午夜亚洲福利老司机| 亚洲成人av一区| 天天综合网 天天综合色| 亚洲国产高清在线| 成人免费在线播放视频| 亚洲色图一区二区三区| 18欧美乱大交hd1984| 亚洲欧美偷拍另类a∨色屁股| 欧美经典一区二区| 亚洲理论在线观看| 丝袜亚洲另类欧美| 国产综合成人久久大片91| 成人永久免费视频|