Translate

Sonntag, 31. Mai 2015

Visual Basic .Net Komplette Fehlermeldung anzeigen

Try
           ...
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
           ...
        End Try

Visual Basic .Net AES-Verschlüsselung

http://www.vbarchiv.net/tipps/tipp_2285-aes-128-und-256-bit-string-verschluesselung.html

Selina Stegerer Facebook


Dienstag, 19. Mai 2015

Fröschl-Beppos Firma


Sonntag, 17. Mai 2015

Visual Basic .Net Tasten abfragen

1. Bei der Form KeyPreview auf True setzen
2.

Private Sub Form_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown 'Readme aufrufen
        If e.KeyCode = Keys.F1 Then
            Process.Start(System.AppDomain.CurrentDomain.BaseDirectory() & "Readme.pdf")'Readme aufrufen
        End If
    End Sub

Visual Basic .Net PDF Datei anzeigen

Process.Start(System.AppDomain.CurrentDomain.BaseDirectory() & "Readme.pdf") 'Readme anzeigen

Visual Basic .Net Datum für Access zusammenbauen

'Heutiges Datum für Access vorbereiten
        Dim HeutigesDatum As String = "#" & DateTime.Today.Year & "-" & DateTime.Today.Month & "-" & DateTime.Today.Day & "#"



Samstag, 16. Mai 2015

'Cannot find DAO350.dll' file error VB6

The DA0350.dll must be registered. Try this:
On the Visual Basic 6.0 CD (or whatever your installation source is), locate the Dao350.dll file, and then copy it to the directory c:\program files\common files\microsoft shared\DAO. (The Dao350.dll file is located in the \os\system folder on the Visual Basic 6.0 CD.)
To register this file, click Start, click Run, and then type or paste the following line:
Regsvr32 "c:\program files\common files\microsoft shared\DAO\Dao350.dll"
Update:
The VB6TMPL.TLB is probably not installed for your current user. Try to run Visual Basic as administrator and/or try this: http://support.microsoft.com/kb/262976/en-us


2. Diese Datei in den Ordner c:\program files\common files\microsoft shared\DAO kopieren.
3. Start --> "cmd" suchen --> Regsvr32 "c:\program files\common files\microsoft shared\DAO\Dao350.dll" eingeben --> Enter --> Fertig

Siehe auch:

Mittwoch, 13. Mai 2015

Raspberry Pi2

https://www.raspberrypi.org/raspberry-pi-2-on-sale/

Budapest-George Ezra Official HD HQ


Budapest-George Ezra de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Blame it on me-George Ezra Official HD HQ


Blame it on me-George Ezra de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Bring me some water-Melissa Etheridge Official HD HQ


Bring me some water-Melissa Etheridge de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

We are the people-Empire of the sun Official HD HQ


We are the people-Empire of the sun de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Walking on a dream-Empire of the sun Official HD HQ


Walking on a dream-Empire of the sun de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Survival-Eminem Official HD HQ


Survival-Eminem de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Not afraid-Eminem Official HD HQ


Not afraid-Eminem de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Berzerk-Eminem Official HD HQ


Berzerk-Eminem de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Cool kids-Echosmith Official HD HQ


Cool kids-Echosmith de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Heartbeat song-Kelly Clarkson Official HD HQ


Heartbeat song-Kelly Clarkson de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Break the rules-Charli XCX Official HD HQ


Break the rules-Charli XCX de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Nachtschicht-Unheilig Official HD HQ


Nachtschicht-Unheilig de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Abwärts-Unheilig Official HD HQ


Abwärts-Unheilig de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Riptide-Vance Joy Official HD HQ


Riptide-Vance Joy de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

First time-Vance Joy Official HD HQ


First time-Vance Joy de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

First time-Vance Joy

Alles okay-Ventim Official HD HQ


Alles okay-Ventim de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Brenna dads guard-Hubert von Goisern Official HD HQ


Brenna dads guard-Hubert von Goisern de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Jump-Van Halen Official HD HQ


Jump-Van Halen de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Wir haben Grund zum Feiern-Otto Waalkes Official HD HQ


Wir haben Grund zum Feiern-Otto Waalkes de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

The days-Robbie Williams Official HD HQ


The days-Robbie Williams de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

She's Madonna-Robbie Williams Official HD HQ


She's Madonna-Robbie Williams de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Shame-Robbie Williams Official HD


Shame-Robbie Williams de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

The days-Avicii Official HD


The days-Avicii de FranzHuber23

Twitter: @FranzHuber23
Twitter: @TheFranzHuber23
Homepage
Keine Homepage
Facebook
Facebook
Youtube:FranzHuber23
Youtube:HansDampf99984
Youtube:LetsZockClassic
Youtube:Elon Musk
Google+:FranzHuber23
Google+:LetsZockClassic
Google+:HansDampf99984
Google+:Elon Musk

Kostenlose, freie Software auf softwareload24.de.tl


Kostenlose, freie Software gib'ts auf meiner neuen Seite: softwareload24.de.tl

Dienstag, 12. Mai 2015

Visual Basic .net verschiedene Farben pro Zeile in Richtextbox

RichTextBox_Hinweise.SelectionStart = 0
RichTextBox_Hinweise.SelectionLength = 1
RichTextBox_Hinweise.SelectionColor = Color.Red
RichTextBox_Hinweise.SelectionStart =1
RichTextBox_Hinweise.SelectionLength = 1
RichTextBox_Hinweise.SelectionColor = Color.Green

Visual Basic .net Datagridview in PDF exportieren


Export Windows Forms DataGridView to PDF using iTextSharp, C# and VB.Net

25 May 2014  
6 Comments   23301 Views

Here Mudassar Ahmed Khan has explained how to export DataGridView data to PDF file in Windows Forms (WinForms) Applications using iTextSharp PDF conversion library, C# and VB.Net.

DataGridView cannot be exported directly to PDF file and hence need to make use of iTextSharp Table for this purpose.

In this article I will explain how to export DataGridView data to PDF file in Windows Forms (WinForms) Applications using iTextSharp PDF conversion library, C# and VB.Net.
DataGridView cannot be exported directly to PDF file and hence need to make use of iTextSharp Table for this purpose.
 
Form Controls
I have added a DataGridView and a Button to the Windows Form.
Export Windows Forms DataGridView to PDF using iTextSharp, C# and VB.Net
 
 
Namespaces
You will need to import the following namespaces.
C#
using System.IO;
using System.Data;
using System.Reflection;
using iTextSharp.text.pdf;
using iTextSharp.text;
 
VB.Net
Imports System.IO
Imports System.Data
Imports System.Reflection
Imports iTextSharp.text
Imports iTextSharp.text.pdf
 
 
Populating DataGridView
In order to populate the DataGridView, I have created a dynamic DataTable with some sample data.
C#
public Form1()
{
    InitializeComponent();
    this.BindDataGridView();
}
 
private void BindDataGridView()
{
    DataTable dt = new DataTable();
    dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Id", typeof(int)),
            new DataColumn("Name", typeof(string)),
            new DataColumn("Country",typeof(string)) });
    dt.Rows.Add(1, "John Hammond", "United States");
    dt.Rows.Add(2, "Mudassar Khan", "India");
    dt.Rows.Add(3, "Suzanne Mathews", "France");
    dt.Rows.Add(4, "Robert Schidner", "Russia");
    this.dataGridView1.DataSource = dt;
}
 
VB.Net
Public Sub New()
    InitializeComponent()
    Me.BindDataGridView()
End Sub
 
Private Sub BindDataGridView()
    Dim dt As New DataTable()
    dt.Columns.AddRange(New DataColumn() {New DataColumn("Id", GetType(Integer)), _
                                           New DataColumn("Name", GetType(String)), _
                                           New DataColumn("Country", GetType(String))})
    dt.Rows.Add(1, "John Hammond", "United States")
    dt.Rows.Add(2, "Mudassar Khan", "India")
    dt.Rows.Add(3, "Suzanne Mathews", "France")
    dt.Rows.Add(4, "Robert Schidner", "Russia")
    Me.dataGridView1.DataSource = dt
End Sub
 
Export Windows Forms DataGridView to PDF using iTextSharp, C# and VB.Net
 
 
Exporting DataGridView data to PDF
Inside the Button Click event handler, I have written the code for exporting DataGridView data to PDF file.
An iTextSharp PDF Table is created with columns same as that of the DataGridView and then a loop is executed over the DataGridView columns to add their header texts to the PDF Table header row.
Once the header row is populated then loop is executed over the DataGridView rows to create the PDF Table rows.
Then a directory (folder) is created if it does not exists. This folder will be used to save the generated PDF file.
Finally the PDF Table is added to the iTextSharp PDF document and then the PDF document is saved as PDF file to the directory that we had created earlier.
C#
private void btnExportPdf_Click(object sender, EventArgs e)
{
    //Creating iTextSharp Table from the DataTable data
    PdfPTable pdfTable = new PdfPTable(dataGridView1.ColumnCount);
    pdfTable.DefaultCell.Padding = 3;
    pdfTable.WidthPercentage = 30;
    pdfTable.HorizontalAlignment = Element.ALIGN_LEFT;
    pdfTable.DefaultCell.BorderWidth = 1;
 
    //Adding Header row
    foreach (DataGridViewColumn column in dataGridView1.Columns)
    {
        PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText));
        cell.BackgroundColor = new iTextSharp.text.Color(240, 240, 240);
        pdfTable.AddCell(cell);
    }
 
    //Adding DataRow
    foreach (DataGridViewRow row in dataGridView1.Rows)
    {
        foreach (DataGridViewCell cell in row.Cells)
        {
            pdfTable.AddCell(cell.Value.ToString());
        }
    }
 
    //Exporting to PDF
    string folderPath = "C:\\PDFs\\";
    if (!Directory.Exists(folderPath))
    {
        Directory.CreateDirectory(folderPath);
    }
    using (FileStream stream = new FileStream(folderPath + "DataGridViewExport.pdf", FileMode.Create))
    {
        Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
        PdfWriter.GetInstance(pdfDoc, stream);
        pdfDoc.Open();
        pdfDoc.Add(pdfTable);
        pdfDoc.Close();
        stream.Close();
    }
}
 
VB.Net
Private Sub btnExportPDF_Click(sender As System.Object, e As System.EventArgs) Handles btnExportPDF.Click
    'Creating iTextSharp Table from the DataTable data
    Dim pdfTable As New PdfPTable(dataGridView1.ColumnCount)
    pdfTable.DefaultCell.Padding = 3
    pdfTable.WidthPercentage = 30
    pdfTable.HorizontalAlignment = Element.ALIGN_LEFT
    pdfTable.DefaultCell.BorderWidth = 1
 
    'Adding Header row
    For Each column As DataGridViewColumn In dataGridView1.Columns
        Dim cell As New PdfPCell(New Phrase(column.HeaderText))
        cell.BackgroundColor = New iTextSharp.text.Color(240, 240, 240)
        pdfTable.AddCell(cell)
    Next
 
    'Adding DataRow
    For Each row As DataGridViewRow In dataGridView1.Rows
        For Each cell As DataGridViewCell In row.Cells
            pdfTable.AddCell(cell.Value.ToString())
        Next
    Next
 
    'Exporting to PDF
    Dim folderPath As String = "C:\PDFs\"
    If Not Directory.Exists(folderPath) Then
        Directory.CreateDirectory(folderPath)
    End If
    Using stream As New FileStream(folderPath & "DataGridViewExport.pdf", FileMode.Create)
        Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 10.0F, 0.0F)
        PdfWriter.GetInstance(pdfDoc, stream)
        pdfDoc.Open()
        pdfDoc.Add(pdfTable)
        pdfDoc.Close()
        stream.Close()
    End Using
End Sub
 
Export Windows Forms DataGridView to PDF using iTextSharp, C# and VB.Net
 
 
Downloads
Related Articles
Comments
kennethJun 04, 2014 06:06 AM  121.54.58.247  
I will try this one if it is really working.. Thanks for Sharing..
SACHIN JAINAug 06, 2014 09:08 AM  180.149.39.40  
NICE WORK its working for me. Thanks
NandeshwarFeb 10, 2015 12:02 PM  122.172.166.118  
Finally its working.. Its very useful for me.. Thanks a lot
GouthamApr 08, 2015 09:04 AM  106.51.141.139  
thanks alottt....
sreenivasApr 17, 2015 12:04 PM  198.133.214.10  
Thanks Its working
Add Comments
You can add your comment about this article using the form below. Make sure you provide a valid email address
else you won't be notified when the author replies to your comment

Please note that all comments are moderated and will be deleted if they are
  • Not relavant to the article
  • Spam
  • Advertising campaigns or links to other sites
  • Abusive content.
Please do not post code, scripts or snippets.


Captcha