EDIT: Never mind, silly me, I read it wrong, I got it now thanks, +REP
, Just a little minor mistake XDtxtMain.WordWrap = wordWrapMenuStripItem.Checked
Edited by Nickalbokid96, 21 July 2009 - 07:19 PM.
Thryckz - Today, 02:51 PM
Luthfi - Today, 11:48 AM
Luthfi - Today, 11:40 AM
Alcamech - Today, 11:01 AM
LukeDavies13 - Today, 10:23 AM
Posted 21 July 2009 - 01:08 PM
, Just a little minor mistake XDtxtMain.WordWrap = wordWrapMenuStripItem.Checked
Edited by Nickalbokid96, 21 July 2009 - 07:19 PM.
Posted 22 July 2009 - 07:36 AM
Posted 27 July 2009 - 01:02 PM
[COLOR=Blue]private void[/COLOR] printPreviewToolStripMenuItem_Click([COLOR=Blue]object[/COLOR] sender, [COLOR=MediumTurquoise]EventArgs[/COLOR] e)
{
System.Drawing.Printing.[COLOR=MediumTurquoise]PrintDocument[/COLOR] prntDoc = [COLOR=Blue]new[/COLOR] System.Drawing.Printing.[COLOR=MediumTurquoise]PrintDocument[/COLOR]();
[COLOR=SeaGreen]//Declare preview as a new PrintPreviewDialog[/COLOR]
[COLOR=MediumTurquoise]PrintPreviewDialog[/COLOR] preview = [COLOR=Blue]new[/COLOR] [COLOR=MediumTurquoise]PrintPreviewDialog[/COLOR]();
[COLOR=SeaGreen]//Declare prntDoc_PrintPage as a new EventHandler for prntDoc's Print Page[/COLOR]
prntDoc.PrintPage += [COLOR=Blue]new[/COLOR] System.Drawing.Printing.[COLOR=MediumTurquoise]PrintPageEventHandler[/COLOR](prntDoc_PrintPage);
[COLOR=SeaGreen]//Set the PrintPreview's Document equal to prntDoc[/COLOR]
preview.Document = prntDoc;
[COLOR=SeaGreen]//Show the PrintPreview Dialog[/COLOR]
[COLOR=Blue]if[/COLOR] (preview.ShowDialog([COLOR=Blue]this[/COLOR]) == [COLOR=MediumTurquoise]DialogResult[/COLOR].OK)
{
[COLOR=SeaGreen]//Generate the PrintPreview[/COLOR]
prntDoc.Print();
}
}
My error is: Posted 16 March 2012 - 07:12 AM
Posted 13 April 2012 - 07:24 PM
Posted 26 April 2012 - 05:34 PM
Posted 24 July 2012 - 12:02 PM
Posted 03 March 2013 - 04:22 AM
I also seem to be having a problem with prntDoc. Here's what I've got:
[COLOR=Blue]private void[/COLOR] printPreviewToolStripMenuItem_Click([COLOR=Blue]object[/COLOR] sender, [COLOR=MediumTurquoise]EventArgs[/COLOR] e) { System.Drawing.Printing.[COLOR=MediumTurquoise]PrintDocument[/COLOR] prntDoc = [COLOR=Blue]new[/COLOR] System.Drawing.Printing.[COLOR=MediumTurquoise]PrintDocument[/COLOR](); [COLOR=SeaGreen]//Declare preview as a new PrintPreviewDialog[/COLOR] [COLOR=MediumTurquoise]PrintPreviewDialog[/COLOR] preview = [COLOR=Blue]new[/COLOR] [COLOR=MediumTurquoise]PrintPreviewDialog[/COLOR](); [COLOR=SeaGreen]//Declare prntDoc_PrintPage as a new EventHandler for prntDoc's Print Page[/COLOR] prntDoc.PrintPage += [COLOR=Blue]new[/COLOR] System.Drawing.Printing.[COLOR=MediumTurquoise]PrintPageEventHandler[/COLOR](prntDoc_PrintPage); [COLOR=SeaGreen]//Set the PrintPreview's Document equal to prntDoc[/COLOR] preview.Document = prntDoc; [COLOR=SeaGreen]//Show the PrintPreview Dialog[/COLOR] [COLOR=Blue]if[/COLOR] (preview.ShowDialog([COLOR=Blue]this[/COLOR]) == [COLOR=MediumTurquoise]DialogResult[/COLOR].OK) { [COLOR=SeaGreen]//Generate the PrintPreview[/COLOR] prntDoc.Print(); } }My error is:
Error 1 The name 'prntDoc_PrintPage' does not exist in the current context c:\CSharp Tutorials\Notepad\Form1.cs 71
(yes, I realize I didn't change the name of the form)
If someone could please point me in the right direction. Also, as I mentioned in my other reply today, this is my first time working with c# or VS. I have some knowledge in other languages though, and understand all the basic functions. I'm just trying to learn as much as I can as I got a job (finally) doing these kinds of things. So if you want to throw in any extra explanation, it WILL be read, I promise.
Edit:
I say first time, but I have made a form before (within past few days) that basically asks for a date frame and pulls up a report after sending a query to MySQL and another one with Microsoft SQL. However, I would like to understand and learn more about coding, not just dropping parts in and pointing them places. So really, what I'm asking is, how is this defined? how does it work? Not just what is the correct code, but actually how to fix it.
Also- note for anyone who hasn't used both- Microsoft SQL is way better.... syntax is different a little bit (having clause, aggregate functions), but it's way faster at actually running the query.
change prntDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(prntDoc_PrintPage); to
prntDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(printPreviewToolStripMenuItem_Click);
Posted 17 May 2013 - 12:39 PM
this lines are giving errors. it cant read
prntDoc, txtMain
Posted 17 May 2013 - 12:48 PM
People, please learn how to use lambda expression when you are writting an event handler. Your life will be much easier.
Posted Yesterday, 11:58 PM
when i was checking the code of notepad.. some functions was not working
e.g.1)txtMain.Clear(), (2) prntDoc.Print();
can u help me..
![]() |
|
|
|
![]() |
Coding a simple app to render web service data in Android - Best approach?Started by misao, 15 May 2013 In: General Forums → Mobile Development |
|
|
![]() |
|
|
|
![]() |
A very simple program in JavaStarted by mac2cd, 10 May 2013 In: Language Forums → Java |
|
|
![]() |
Easy And Simple VB.NET Form Sliding Effetct !Started by viveq, 09 May 2013 In: Language Forums → Visual Basic |
|
|
Language Forums →
C# →
Simple Text Editors in C#Started by ztc1234, 16 Sep 2012 |
|
|
||
Language Forums →
C# →
Save String <List>Started by slava, 31 May 2012 |
|
|
||
![]() |
Managed C++
Language Forums →
C and C++ →
[SOLVED] Scaning Bad ProcessesStarted by Tonchi, 27 May 2012 |
|
|
|
Tutorial Forums →
C# Tutorials →
Export To Excel Easy (From Datatables)Started by BlackRabbit, 26 May 2012 |
|
|
||
Tutorial Forums →
C# Tutorials →
StreamWriters and StreamReadersStarted by Cushpajz, 17 Dec 2011 |
|
|