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

C#

 
QuestionCode Error! Pin
Shahzad.Aslam31-Jul-06 0:04
Shahzad.Aslam31-Jul-06 0:04 
AnswerRe: Code Error! Pin
rah_sin31-Jul-06 0:11
professionalrah_sin31-Jul-06 0:11 
AnswerRe: Code Error! [modified] Pin
J4amieC31-Jul-06 0:27
J4amieC31-Jul-06 0:27 
Questionusing cab files Pin
JacquesDP31-Jul-06 0:01
JacquesDP31-Jul-06 0:01 
Questionstartup form? Pin
psamy30-Jul-06 23:37
psamy30-Jul-06 23:37 
AnswerRe: startup form? Pin
Colin Angus Mackay30-Jul-06 23:38
Colin Angus Mackay30-Jul-06 23:38 
AnswerRe: startup form? Pin
rah_sin30-Jul-06 23:59
professionalrah_sin30-Jul-06 23:59 
Questionpls help with this print codes Pin
skyeddie30-Jul-06 23:15
skyeddie30-Jul-06 23:15 
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace PrintForm
{
///
/// Summary description for frmTest.
///

public class frmTest : System.Windows.Forms.Form
{
#region UI Variables

private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

#endregion

#region Constructors

public frmTest()
{
InitializeComponent();
}

#endregion

#region Windows Form Designer generated code
///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.btnPrint = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(104, 328);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(120, 40);
this.btnPrint.TabIndex = 1;
this.btnPrint.Text = "Print this form";
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 32);
this.label1.TabIndex = 2;
this.label1.Text = "Name";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 24);
this.label2.TabIndex = 3;
this.label2.Text = "IC";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// button1
//
this.button1.Location = new System.Drawing.Point(24, 128);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(56, 32);
this.button1.TabIndex = 4;
this.button1.Text = "Receipt";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(128, 32);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(208, 20);
this.textBox1.TabIndex = 5;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(128, 80);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(208, 20);
this.textBox2.TabIndex = 6;
this.textBox2.Text = "textBox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(128, 136);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(208, 20);
this.textBox3.TabIndex = 7;
this.textBox3.Text = "textBox3";
//
// frmTest
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(360, 390);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnPrint);
this.Name = "frmTest";
this.Text = "Test Form";
this.ResumeLayout(false);

}
#endregion

#region Main

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new frmTest());
}

#endregion

#region UI Event Handlers

private void btnPrint_Click(object sender, System.EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;

PrintForm pf = new PrintForm(this);
pf.Print();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
finally
{
this.Cursor = Cursors.Default;
}
}

#endregion

private void button1_Click(object sender, System.EventArgs e)
{
int counter;

counter = 50;

int i;

Random r = new Random();

for(i =0;i
AnswerRe: pls help with this print codes Pin
Vipin Venugopal31-Jul-06 0:20
Vipin Venugopal31-Jul-06 0:20 
GeneralRe: pls help with this print codes Pin
skyeddie31-Jul-06 16:53
skyeddie31-Jul-06 16:53 
GeneralRe: pls help with this print codes Pin
Vipin Venugopal31-Jul-06 17:58
Vipin Venugopal31-Jul-06 17:58 
GeneralRe: pls help with this print codes Pin
skyeddie31-Jul-06 18:54
skyeddie31-Jul-06 18:54 
GeneralRe: pls help with this print codes [modified] Pin
Vipin Venugopal31-Jul-06 19:03
Vipin Venugopal31-Jul-06 19:03 
GeneralRe: pls help with this print codes Pin
skyeddie31-Jul-06 19:16
skyeddie31-Jul-06 19:16 
GeneralRe: pls help with this print codes Pin
Vipin Venugopal31-Jul-06 19:21
Vipin Venugopal31-Jul-06 19:21 
GeneralRe: pls help with this print codes Pin
skyeddie31-Jul-06 20:10
skyeddie31-Jul-06 20:10 
GeneralRe: pls help with this print codes Pin
Vipin Venugopal31-Jul-06 20:24
Vipin Venugopal31-Jul-06 20:24 
Questionplacing the cursor Pin
sarojkumarjena30-Jul-06 23:09
sarojkumarjena30-Jul-06 23:09 
AnswerRe: placing the cursor Pin
stancrm30-Jul-06 23:29
stancrm30-Jul-06 23:29 
AnswerRe: placing the cursor Pin
LongRange.Shooter31-Jul-06 5:29
LongRange.Shooter31-Jul-06 5:29 
QuestionHow to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? Pin
COBECTb30-Jul-06 22:40
COBECTb30-Jul-06 22:40 
AnswerRe: How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? Pin
Vipin Venugopal30-Jul-06 23:11
Vipin Venugopal30-Jul-06 23:11 
GeneralRe: How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? Pin
COBECTb30-Jul-06 23:38
COBECTb30-Jul-06 23:38 
GeneralRe: How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? Pin
Vipin Venugopal31-Jul-06 0:03
Vipin Venugopal31-Jul-06 0:03 
GeneralRe: How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? Pin
COBECTb31-Jul-06 3:33
COBECTb31-Jul-06 3:33 

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.