Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralConvert string to class (sort of) Pin
MrEyes10-Nov-03 6:30
MrEyes10-Nov-03 6:30 
GeneralRe: Convert string to class (sort of) Pin
Wjousts10-Nov-03 7:06
Wjousts10-Nov-03 7:06 
GeneralRe: Convert string to class (sort of) Pin
MrEyes10-Nov-03 7:09
MrEyes10-Nov-03 7:09 
GeneralRe: Convert string to class (sort of) Pin
Heath Stewart10-Nov-03 7:44
protectorHeath Stewart10-Nov-03 7:44 
GeneralA couple of line drawing questions... Pin
DoofToo10-Nov-03 6:12
DoofToo10-Nov-03 6:12 
GeneralRe: A couple of line drawing questions... Pin
mhmoud rawas11-Nov-03 1:36
mhmoud rawas11-Nov-03 1:36 
GeneralPrinting.. Pin
Amirjalaly10-Nov-03 5:50
Amirjalaly10-Nov-03 5:50 
GeneralRe: Printing.. Pin
Heath Stewart10-Nov-03 6:01
protectorHeath Stewart10-Nov-03 6:01 
Did you look at the documentation for PrintDialog? Seriously - researching problems is an important development skill. If you did, the class documentation has a good example of how exactly this is done:
// Declare the PrintDocument object.
private System.Drawing.Printing.PrintDocument docToPrint =
    new System.Drawing.Printing.PrintDocument();

// This method will set properties on the PrintDialog object and
// then display the dialog.
private void Button1_Click(System.Object sender,
    System.EventArgs e)
{

    // Allow the user to choose the page range he or she would
    // like to print.
    PrintDialog1.AllowSomePages = true;

    // Show the help button.
    PrintDialog1.ShowHelp = true;

    // Set the Document property to the PrintDocument for
    // which the PrintPage Event has been handled. To display the
    // dialog, either this property or the PrinterSettings property
    // must be set
    PrintDialog1.Document = docToPrint;

    DialogResult result = PrintDialog1.ShowDialog();

    // If the result is OK then print the document.
    if (result==DialogResult.OK)
    {
        docToPrint.Print();
    }

}

// The PrintDialog will print the document
// by handling the document's PrintPage event.
private void document_PrintPage(object sender,
    System.Drawing.Printing.PrintPageEventArgs e)
{

    // Insert code to render the page here.
    // This code will be called when the control is drawn.

    // The following code will render a simple
    // message on the printed document.
    string text = "In document_PrintPage method.";
    System.Drawing.Font printFont = new System.Drawing.Font
        ("Arial", 35, System.Drawing.FontStyle.Regular);

    // Draw the content.
    e.Graphics.DrawString(text, printFont,
        System.Drawing.Brushes.Black, 10, 10);
}


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRemoting and Events Pin
CillyMe10-Nov-03 5:08
CillyMe10-Nov-03 5:08 
GeneralRe: Remoting and Events Pin
Heath Stewart10-Nov-03 5:39
protectorHeath Stewart10-Nov-03 5:39 
GeneralRe: Remoting and Events Pin
CillyMe10-Nov-03 5:44
CillyMe10-Nov-03 5:44 
GeneralRe: Remoting and Events Pin
Heath Stewart10-Nov-03 5:51
protectorHeath Stewart10-Nov-03 5:51 
GeneralRe: Remoting and Events Pin
CillyMe10-Nov-03 14:37
CillyMe10-Nov-03 14:37 
GeneralRe: Remoting and Events Pin
Heath Stewart11-Nov-03 2:55
protectorHeath Stewart11-Nov-03 2:55 
GeneralRe: Remoting and Events Pin
LongRange.Shooter10-Nov-03 6:04
LongRange.Shooter10-Nov-03 6:04 
GeneralEnumerating Data Sources in C# Pin
Inam10-Nov-03 4:41
Inam10-Nov-03 4:41 
GeneralRe: Enumerating Data Sources in C# Pin
Heath Stewart10-Nov-03 5:33
protectorHeath Stewart10-Nov-03 5:33 
GeneralAlternatives to databinding Pin
Wjousts10-Nov-03 4:19
Wjousts10-Nov-03 4:19 
GeneralWindows Security check fails when it should not??!! Pin
LongRange.Shooter10-Nov-03 4:16
LongRange.Shooter10-Nov-03 4:16 
GeneralRe: Windows Security check fails when it should not??!! Pin
Heath Stewart10-Nov-03 5:32
protectorHeath Stewart10-Nov-03 5:32 
GeneralRe: Windows Security check fails when it should not??!! Pin
LongRange.Shooter10-Nov-03 6:25
LongRange.Shooter10-Nov-03 6:25 
GeneralAbsolute beginner Pin
-=LoKi=-10-Nov-03 2:03
-=LoKi=-10-Nov-03 2:03 
GeneralRe: Absolute beginner Pin
Heath Stewart10-Nov-03 3:37
protectorHeath Stewart10-Nov-03 3:37 
GeneralRe: Absolute beginner Pin
-=LoKi=-11-Nov-03 2:37
-=LoKi=-11-Nov-03 2:37 
GeneralRe: Absolute beginner Pin
Heath Stewart11-Nov-03 3:04
protectorHeath Stewart11-Nov-03 3:04 

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.