Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: Splash Screen Architecture Pin
Christian Graus4-Jul-05 13:09
protectorChristian Graus4-Jul-05 13:09 
GeneralRe: Splash Screen Architecture Pin
S. Senthil Kumar4-Jul-05 19:22
S. Senthil Kumar4-Jul-05 19:22 
GeneralRe: Splash Screen Architecture Pin
cmaissan4-Jul-05 14:16
cmaissan4-Jul-05 14:16 
GeneralRe: Splash Screen Architecture Pin
1nsp1r3d5-Jul-05 0:11
1nsp1r3d5-Jul-05 0:11 
GeneralMDI Form Pin
Newbie_Toy3-Jul-05 8:25
Newbie_Toy3-Jul-05 8:25 
GeneralRe: MDI Form Pin
Libor Tinka3-Jul-05 12:56
Libor Tinka3-Jul-05 12:56 
GeneralRe: MDI Form Pin
Libor Tinka3-Jul-05 12:58
Libor Tinka3-Jul-05 12:58 
GeneralPrinting Pin
Jerry Hammond3-Jul-05 6:04
Jerry Hammond3-Jul-05 6:04 
This snippet activates the paper feed but does not result in any printed text.

using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
using System.Drawing.Printing;<br />
<br />
namespace _316CH11<br />
{<br />
	/// <summary><br />
	/// Summary description for Form1.<br />
	/// </summary><br />
	public class Form1 : System.Windows.Forms.Form<br />
	{<br />
		private System.Windows.Forms.TextBox txtText;<br />
		private System.Windows.Forms.Button btnPrint;<br />
		private System.Drawing.Printing.PrintDocument printDocument1;<br />
		/// <summary><br />
		/// Required designer variable.<br />
		/// </summary><br />
		private System.ComponentModel.Container components = null;<br />
<br />
		public Form1()<br />
		{<br />
			//<br />
			// Required for Windows Form Designer support<br />
			//<br />
			InitializeComponent();<br />
<br />
			//<br />
			// TODO: Add any constructor code after InitializeComponent call<br />
			//<br />
		}<br />
<br />
		/// <summary><br />
		/// Clean up any resources being used.<br />
		/// </summary><br />
		protected override void Dispose( bool disposing )<br />
		{<br />
			if( disposing )<br />
			{<br />
				if (components != null) <br />
				{<br />
					components.Dispose();<br />
				}<br />
			}<br />
			base.Dispose( disposing );<br />
		}<br />
<br />
		#region Windows Form Designer generated code<br />
		/// <summary><br />
		/// Required method for Designer support - do not modify<br />
		/// the contents of this method with the code editor.<br />
		/// </summary><br />
		private void InitializeComponent()<br />
		{<br />
			this.txtText = new System.Windows.Forms.TextBox();<br />
			this.btnPrint = new System.Windows.Forms.Button();<br />
			this.printDocument1 = new System.Drawing.Printing.PrintDocument();<br />
			this.SuspendLayout();<br />
			// <br />
			// txtText<br />
			// <br />
			this.txtText.Location = new System.Drawing.Point(0, 0);<br />
			this.txtText.Multiline = true;<br />
			this.txtText.Name = "txtText";<br />
			this.txtText.Size = new System.Drawing.Size(176, 125);<br />
			this.txtText.TabIndex = 0;<br />
			this.txtText.Text = "";<br />
			// <br />
			// btnPrint<br />
			// <br />
			this.btnPrint.Location = new System.Drawing.Point(0, 136);<br />
			this.btnPrint.Name = "btnPrint";<br />
			this.btnPrint.Size = new System.Drawing.Size(176, 23);<br />
			this.btnPrint.TabIndex = 1;<br />
			this.btnPrint.Text = "&Print";<br />
			this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);<br />
			// <br />
			// printDocument1<br />
			// <br />
			this.printDocument1.DocumentName = "NetDocument11-1";<br />
			// <br />
			// Form1<br />
			// <br />
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
			this.ClientSize = new System.Drawing.Size(292, 262);<br />
			this.Controls.Add(this.btnPrint);<br />
			this.Controls.Add(this.txtText);<br />
			this.Name = "Form1";<br />
			this.Text = "Form1";<br />
			this.Load += new System.EventHandler(this.Form1_Load);<br />
			this.ResumeLayout(false);<br />
<br />
		}<br />
		#endregion<br />
<br />
		/// <summary><br />
		/// The main entry point for the application.<br />
		/// </summary><br />
		[STAThread]<br />
		static void Main() <br />
		{<br />
			Application.Run(new Form1());<br />
		}<br />
<br />
		private void btnPrint_Click(object sender, System.EventArgs e)<br />
		{<br />
			printDocument1.Print();<br />
		}<br />
		private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
		{<br />
			//Create a font to print with<br />
			Font fnt = new Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel);<br />
			//Print Text<br />
			e.Graphics.DrawString(txtText.Text, fnt, Brushes.Black, 0, 0);<br />
			//Endicate there are no more pages<br />
			e.HasMorePages=false;<br />
		}<br />
<br />
		private void Form1_Load(object sender, System.EventArgs e)<br />
		{<br />
		<br />
		}<br />
	}<br />
}<br />


Any suggestion on what might wrong here?

Most people are willing to pay more to be amused than to be educated--Robert C. Savage, Life Lessons
Toasty0.com
Ladder League (beta)
My Grandkids
GeneralRe: Printing Pin
cmaissan4-Jul-05 14:30
cmaissan4-Jul-05 14:30 
GeneralRe: Printing Pin
Jerry Hammond5-Jul-05 4:43
Jerry Hammond5-Jul-05 4:43 
GeneralHelp me please.... Pin
amarsumanth3-Jul-05 4:21
amarsumanth3-Jul-05 4:21 
GeneralRe: Help me please.... Pin
S. Senthil Kumar3-Jul-05 5:17
S. Senthil Kumar3-Jul-05 5:17 
GeneralRe: Help me please.... Pin
amarsumanth3-Jul-05 10:41
amarsumanth3-Jul-05 10:41 
GeneralRe: Help me please.... Pin
David Stone3-Jul-05 8:06
sitebuilderDavid Stone3-Jul-05 8:06 
GeneralToolbar on System TASKBAR Pin
XironiX3-Jul-05 2:49
sussXironiX3-Jul-05 2:49 
GeneralRe: Toolbar on System TASKBAR Pin
gavinlv3-Jul-05 22:30
gavinlv3-Jul-05 22:30 
Generalshutdown a process Pin
niebo0773-Jul-05 2:09
niebo0773-Jul-05 2:09 
GeneralRe: shutdown a process Pin
Dave Kreskowiak3-Jul-05 14:23
mveDave Kreskowiak3-Jul-05 14:23 
GeneralRe: shutdown a process Pin
Matt Gerrans3-Jul-05 22:39
Matt Gerrans3-Jul-05 22:39 
GeneralRe: shutdown a process Pin
Dave Kreskowiak4-Jul-05 2:43
mveDave Kreskowiak4-Jul-05 2:43 
GeneralRe: shutdown a process Pin
Matt Gerrans4-Jul-05 15:32
Matt Gerrans4-Jul-05 15:32 
GeneralRe: shutdown a process Pin
Dave Kreskowiak4-Jul-05 16:50
mveDave Kreskowiak4-Jul-05 16:50 
GeneralRe: shutdown a process Pin
Matt Gerrans4-Jul-05 19:32
Matt Gerrans4-Jul-05 19:32 
GeneralChanging applications exe icon Pin
asmyan3-Jul-05 1:34
asmyan3-Jul-05 1:34 
GeneralRe: Changing applications exe icon Pin
lovelylooney3-Jul-05 1:50
lovelylooney3-Jul-05 1:50 

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.