|
You want to turn this one string into an instance of this struct ? How do you know which bit belongs to which string ? It's not going to happen for you automatically, you need to write some string mashing code.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
I am using IProvideTaskPage::GetPage() and want to incorporate those pages as well as my own in a Custom Task Wizard written in C#. How would one implement this in C#? CPropertyPage && CPropertySheet worked well in MFC.
Sincerely,
-Ron
|
|
|
|
|
RNEELY wrote:
Where is CPropertyPage?
TabControl
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
Thanks Mazdak. The TabControl seems to provide the same look.
IProvideTaskPage::GetPage() returns an array of HPROPSHEETPAGE.
How could I use that array with the TabControl?
Ziggy played guitar. Man could he play guitar.
Sincerely,
-Ron
|
|
|
|
|
Did you read the docs for TabControl ? There's a TabPages collection property that has a collection of TabPage instances. Sub-class the TabPage if you want, but you don't need to. The TabControl is fully designable in VS.NET as well. Just try it out.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I was wondering how to display a datagrid that has some of the values hyperlinked and the rest not hyperlinked. Ex....I have a single column that displays numbers. If the result is 10 or above, then apply the hyperlink and all results 9 and below, do not apply hyperlink. I am very mucha beginner at this whole .NET stuff, so dummy it up if possible or provide a code snippit.
Thanks a lot
Skooter
|
|
|
|
|
First of all, this should be asked in the ASP.NET forum. But I'll answer anyway since ASP.NET apps can be written in C# of course.
You should handle the DataGrid.ItemCreated event. The handler arguments will let you access the Item property that will - in your case - be a DataRowView . Cast it to that class and see what the number value is. Then you can dedice whether to use a HyperLink control or not (or always use a HyperLink control and just set certain properties to disable the actual linking).
For an example of how to do this, see Summary Rows in DataGrid Controls[^]. It's not exactly what you're after, but should give you some idea of how to handle each item as the DataGrid control creates it in the Page so that you can override properties or even add controls to the table cell (like the HyperLink control).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
im new to C# , so im not really sure of my options. i dont want to use databases , but i want something similar. If i use files , then the problem comes when deleting a record.
my main aim is that i should be able to retrieve records from a file , make all changes and then dump it into a file.
can i use datasets and then dump the final thing into the o/p file ?
or are there other options ? like XML , message queues etc ? if so then i'd appreciate if you could guide me !
|
|
|
|
|
Ashwin C wrote:
like XML
Exactly. Look XmlDataDocument in MSDN. You can populate DataSet with it and do your jobs and. change back to file.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
hmm i was looking at it right now , i think i'll try out this serializer thing.
thanks tho !
|
|
|
|
|
Anyone know how to get the current build version (as defined in 'assemblyinfo.cs') programmatically, e.g. so it can be shown in an 'about box', without learning masses of (irrelevant?) stuff about assemblies?
Seems such a simple requirement but I can't find an answer!
|
|
|
|
|
|
Application.ProductVersion
|
|
|
|
|
how do you find pics in a drive and then let the user view the pics.
using c#
|
|
|
|
|
paste this into your form1 that should work
|
|
|
|
|
paste this into your form1 that should work
terry
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace PicSearch
{
///
/// Summary description for Form1.
///
public class PizzaCheckout : System.Windows.Forms.Form
{
private System.Windows.Forms.Label name;
private System.Windows.Forms.Label phone;
private System.Windows.Forms.Label dash;
private System.Windows.Forms.Label addresslb;
private System.Windows.Forms.Label lbcheque;
private System.Windows.Forms.CheckBox extraCheese;
private System.Windows.Forms.CheckBox pepperoni;
private System.Windows.Forms.CheckBox italianSausage;
private System.Windows.Forms.CheckBox ham;
private System.Windows.Forms.CheckBox jalapeno;
private System.Windows.Forms.CheckBox groundBeef;
private System.Windows.Forms.CheckBox GreenPeppers;
private System.Windows.Forms.CheckBox mushrooms;
private System.Windows.Forms.CheckBox olives;
private System.Windows.Forms.Button placeOrder;
private System.Windows.Forms.Button btClear;
private System.Windows.Forms.Label lbtotal;
private System.Windows.Forms.Label lbtax;
private System.Windows.Forms.Label lbsubtotal;
private System.Windows.Forms.Label lbtopping;
private System.Windows.Forms.Label lbpizza;
private System.Windows.Forms.GroupBox groupBoxPayment;
private System.Windows.Forms.GroupBox groupBoxSize;
private System.Windows.Forms.GroupBox groupBoxToppings;
private System.Windows.Forms.GroupBox groupBoxOrder;
private System.Windows.Forms.PictureBox pictureBoxPizza;
private System.Windows.Forms.RadioButton radioButtonCash;
private System.Windows.Forms.TextBox textBoxName;
private System.Windows.Forms.TextBox textBoxPhone;
private System.Windows.Forms.TextBox textBoxPhone2;
private System.Windows.Forms.TextBox textBoxAddress;
private System.Windows.Forms.TextBox textBoxCheque;
private System.Windows.Forms.RadioButton radioButtonCheque;
private System.Windows.Forms.RadioButton radioButtonMastercard;
private System.Windows.Forms.RadioButton radioButtonVisa;
private System.Windows.Forms.RadioButton radioButtonSupreme;
private System.Windows.Forms.RadioButton radioButtonLarge;
private System.Windows.Forms.RadioButton radioButtonMedium;
private System.Windows.Forms.RadioButton radioButtonSmall;
private System.Windows.Forms.TextBox textBoxPizza;
private System.Windows.Forms.TextBox textBoxTotal;
private System.Windows.Forms.TextBox textBoxTax;
private System.Windows.Forms.TextBox textBoxSubtotal;
private System.Windows.Forms.TextBox textBoxToppings;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public PizzaCheckout()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PizzaCheckout));
this.name = new System.Windows.Forms.Label();
this.textBoxName = new System.Windows.Forms.TextBox();
this.phone = new System.Windows.Forms.Label();
this.textBoxPhone = new System.Windows.Forms.TextBox();
this.textBoxPhone2 = new System.Windows.Forms.TextBox();
this.dash = new System.Windows.Forms.Label();
this.addresslb = new System.Windows.Forms.Label();
this.textBoxAddress = new System.Windows.Forms.TextBox();
this.lbcheque = new System.Windows.Forms.Label();
this.textBoxCheque = new System.Windows.Forms.TextBox();
this.groupBoxPayment = new System.Windows.Forms.GroupBox();
this.radioButtonCash = new System.Windows.Forms.RadioButton();
this.radioButtonCheque = new System.Windows.Forms.RadioButton();
this.radioButtonMastercard = new System.Windows.Forms.RadioButton();
this.radioButtonVisa = new System.Windows.Forms.RadioButton();
this.groupBoxSize = new System.Windows.Forms.GroupBox();
this.radioButtonSupreme = new System.Windows.Forms.RadioButton();
this.radioButtonLarge = new System.Windows.Forms.RadioButton();
this.radioButtonMedium = new System.Windows.Forms.RadioButton();
this.radioButtonSmall = new System.Windows.Forms.RadioButton();
this.groupBoxToppings = new System.Windows.Forms.GroupBox();
this.GreenPeppers = new System.Windows.Forms.CheckBox();
this.mushrooms = new System.Windows.Forms.CheckBox();
this.olives = new System.Windows.Forms.CheckBox();
this.ham = new System.Windows.Forms.CheckBox();
this.jalapeno = new System.Windows.Forms.CheckBox();
this.groundBeef = new System.Windows.Forms.CheckBox();
this.italianSausage = new System.Windows.Forms.CheckBox();
this.pepperoni = new System.Windows.Forms.CheckBox();
this.extraCheese = new System.Windows.Forms.CheckBox();
this.placeOrder = new System.Windows.Forms.Button();
this.btClear = new System.Windows.Forms.Button();
this.groupBoxOrder = new System.Windows.Forms.GroupBox();
this.textBoxTotal = new System.Windows.Forms.TextBox();
this.textBoxTax = new System.Windows.Forms.TextBox();
this.textBoxSubtotal = new System.Windows.Forms.TextBox();
this.textBoxToppings = new System.Windows.Forms.TextBox();
this.textBoxPizza = new System.Windows.Forms.TextBox();
this.lbtotal = new System.Windows.Forms.Label();
this.lbtax = new System.Windows.Forms.Label();
this.lbsubtotal = new System.Windows.Forms.Label();
this.lbtopping = new System.Windows.Forms.Label();
this.lbpizza = new System.Windows.Forms.Label();
this.pictureBoxPizza = new System.Windows.Forms.PictureBox();
this.groupBoxPayment.SuspendLayout();
this.groupBoxSize.SuspendLayout();
this.groupBoxToppings.SuspendLayout();
this.groupBoxOrder.SuspendLayout();
this.SuspendLayout();
//
// name
//
this.name.Location = new System.Drawing.Point(32, 16);
this.name.Name = "name";
this.name.Size = new System.Drawing.Size(48, 16);
this.name.TabIndex = 0;
this.name.Text = "Name:";
//
// textBoxName
//
this.textBoxName.Location = new System.Drawing.Point(88, 16);
this.textBoxName.Name = "textBoxName";
this.textBoxName.TabIndex = 1;
this.textBoxName.Text = "";
//
// phone
//
this.phone.Location = new System.Drawing.Point(223, 16);
this.phone.Name = "phone";
this.phone.Size = new System.Drawing.Size(64, 16);
this.phone.TabIndex = 2;
this.phone.Text = "Telephone:";
//
// textBoxPhone
//
this.textBoxPhone.Location = new System.Drawing.Point(304, 16);
this.textBoxPhone.MaxLength = 3;
this.textBoxPhone.Name = "textBoxPhone";
this.textBoxPhone.Size = new System.Drawing.Size(24, 20);
this.textBoxPhone.TabIndex = 3;
this.textBoxPhone.Text = "";
//
// textBoxPhone2
//
this.textBoxPhone2.Location = new System.Drawing.Point(344, 16);
this.textBoxPhone2.MaxLength = 4;
this.textBoxPhone2.Name = "textBoxPhone2";
this.textBoxPhone2.Size = new System.Drawing.Size(40, 20);
this.textBoxPhone2.TabIndex = 4;
this.textBoxPhone2.Text = "";
//
// dash
//
this.dash.Location = new System.Drawing.Point(331, 14);
this.dash.Name = "dash";
this.dash.Size = new System.Drawing.Size(8, 14);
this.dash.TabIndex = 5;
this.dash.Text = "_";
//
// addresslb
//
this.addresslb.Location = new System.Drawing.Point(24, 49);
this.addresslb.Name = "addresslb";
this.addresslb.Size = new System.Drawing.Size(48, 16);
this.addresslb.TabIndex = 6;
this.addresslb.Text = "Address:";
//
// textBoxAddress
//
this.textBoxAddress.Location = new System.Drawing.Point(88, 45);
this.textBoxAddress.Name = "textBoxAddress";
this.textBoxAddress.Size = new System.Drawing.Size(296, 20);
this.textBoxAddress.TabIndex = 7;
this.textBoxAddress.Text = "";
//
// lbcheque
//
this.lbcheque.Location = new System.Drawing.Point(8, 128);
this.lbcheque.Name = "lbcheque";
this.lbcheque.Size = new System.Drawing.Size(72, 16);
this.lbcheque.TabIndex = 9;
this.lbcheque.Text = "Cheque/cc#:";
//
// textBoxCheque
//
this.textBoxCheque.Enabled = false;
this.textBoxCheque.Location = new System.Drawing.Point(88, 128);
this.textBoxCheque.Name = "textBoxCheque";
this.textBoxCheque.Size = new System.Drawing.Size(296, 20);
this.textBoxCheque.TabIndex = 10;
this.textBoxCheque.Text = "";
//
// groupBoxPayment
//
this.groupBoxPayment.Controls.AddRange(new System.Windows.Forms.Control[] {
this.radioButtonCash,
this.radioButtonCheque,
this.radioButtonMastercard,
this.radioButtonVisa});
this.groupBoxPayment.Location = new System.Drawing.Point(8, 72);
this.groupBoxPayment.Name = "groupBoxPayment";
this.groupBoxPayment.Size = new System.Drawing.Size(376, 48);
this.groupBoxPayment.TabIndex = 8;
this.groupBoxPayment.TabStop = false;
this.groupBoxPayment.Text = "Payment Type";
//
// radioButtonCash
//
this.radioButtonCash.Checked = true;
this.radioButtonCash.Location = new System.Drawing.Point(312, 16);
this.radioButtonCash.Name = "radioButtonCash";
this.radioButtonCash.Size = new System.Drawing.Size(56, 24);
this.radioButtonCash.TabIndex = 3;
this.radioButtonCash.TabStop = true;
this.radioButtonCash.Text = "Cash";
this.radioButtonCash.CheckedChanged += new System.EventHandler(this.radioButtonCash_CheckedChanged);
//
// radioButtonCheque
//
this.radioButtonCheque.Location = new System.Drawing.Point(208, 16);
this.radioButtonCheque.Name = "radioButtonCheque";
this.radioButtonCheque.Size = new System.Drawing.Size(64, 24);
this.radioButtonCheque.TabIndex = 2;
this.radioButtonCheque.Text = "Cheque";
//
// radioButtonMastercard
//
this.radioButtonMastercard.Location = new System.Drawing.Point(112, 16);
this.radioButtonMastercard.Name = "radioButtonMastercard";
this.radioButtonMastercard.TabIndex = 1;
this.radioButtonMastercard.Text = "Mastercard";
//
// radioButtonVisa
//
this.radioButtonVisa.Location = new System.Drawing.Point(16, 16);
this.radioButtonVisa.Name = "radioButtonVisa";
this.radioButtonVisa.TabIndex = 0;
this.radioButtonVisa.Text = "Visa";
//
// groupBoxSize
//
this.groupBoxSize.Controls.AddRange(new System.Windows.Forms.Control[] {
this.radioButtonSupreme,
this.radioButtonLarge,
this.radioButtonMedium,
this.radioButtonSmall});
this.groupBoxSize.Location = new System.Drawing.Point(8, 151);
this.groupBoxSize.Name = "groupBoxSize";
this.groupBoxSize.Size = new System.Drawing.Size(424, 48);
this.groupBoxSize.TabIndex = 11;
this.groupBoxSize.TabStop = false;
this.groupBoxSize.Text = "Payment Type";
this.groupBoxSize.Enter += new System.EventHandler(this.groupBoxSize_CheckedChanged);
//
// radioButtonSupreme
//
this.radioButtonSupreme.Location = new System.Drawing.Point(296, 16);
this.radioButtonSupreme.Name = "radioButtonSupreme";
this.radioButtonSupreme.Size = new System.Drawing.Size(112, 24);
this.radioButtonSupreme.TabIndex = 3;
this.radioButtonSupreme.Text = "Supreme $18.95";
//
// radioButtonLarge
//
this.radioButtonLarge.Location = new System.Drawing.Point(192, 16);
this.radioButtonLarge.Name = "radioButtonLarge";
this.radioButtonLarge.Size = new System.Drawing.Size(96, 24);
this.radioButtonLarge.TabIndex = 2;
this.radioButtonLarge.Text = "Large $14.95";
//
// radioButtonMedium
//
this.radioButtonMedium.Location = new System.Drawing.Point(88, 16);
this.radioButtonMedium.Name = "radioButtonMedium";
this.radioButtonMedium.TabIndex = 1;
this.radioButtonMedium.Text = "Medium $11.95";
//
// radioButtonSmall
//
this.radioButtonSmall.Location = new System.Drawing.Point(8, 16);
this.radioButtonSmall.Name = "radioButtonSmall";
this.radioButtonSmall.TabIndex = 0;
this.radioButtonSmall.Text = "Small $7.95";
//
// groupBoxToppings
//
this.groupBoxToppings.Controls.AddRange(new System.Windows.Forms.Control[] {
this.GreenPeppers,
this.mushrooms,
this.olives,
this.ham,
this.jalapeno,
this.groundBeef,
this.italianSausage,
this.pepperoni,
this.extraCheese});
this.groupBoxToppings.Location = new System.Drawing.Point(8, 201);
this.groupBoxToppings.Name = "groupBoxToppings";
this.groupBoxToppings.Size = new System.Drawing.Size(424, 100);
this.groupBoxToppings.TabIndex = 12;
this.groupBoxToppings.TabStop = false;
this.groupBoxToppings.Text = "Toppings ($0.95 each)";
this.groupBoxToppings.Enter += new System.EventHandler(this.groupBoxToppings_CheckedChanged);
//
// GreenPeppers
//
this.GreenPeppers.Location = new System.Drawing.Point(304, 72);
this.GreenPeppers.Name = "GreenPeppers";
this.GreenPeppers.TabIndex = 8;
this.GreenPeppers.Text = "Green Peppers";
//
// mushrooms
//
this.mushrooms.Location = new System.Drawing.Point(304, 48);
this.mushrooms.Name = "mushrooms";
this.mushrooms.TabIndex = 7;
this.mushrooms.Text = "Mushrooms";
//
// olives
//
this.olives.Location = new System.Drawing.Point(304, 24);
this.olives.Name = "olives";
this.olives.TabIndex = 6;
this.olives.Text = "Olives";
//
// ham
//
this.ham.Location = new System.Drawing.Point(160, 72);
this.ham.Name = "ham";
this.ham.TabIndex = 5;
this.ham.Text = "Ham";
//
// jalapeno
//
this.jalapeno.Location = new System.Drawing.Point(160, 48);
this.jalapeno.Name = "jalapeno";
this.jalapeno.TabIndex = 4;
this.jalapeno.Text = "Jalapeno";
//
// groundBeef
//
this.groundBeef.Location = new System.Drawing.Point(160, 24);
this.groundBeef.Name = "groundBeef";
this.groundBeef.TabIndex = 3;
this.groundBeef.Text = "Ground Beef";
//
// italianSausage
//
this.italianSausage.Location = new System.Drawing.Point(16, 72);
this.italianSausage.Name = "italianSausage";
this.italianSausage.TabIndex = 2;
this.italianSausage.Text = "Italian Sausage";
//
// pepperoni
//
this.pepperoni.Location = new System.Drawing.Point(16, 48);
this.pepperoni.Name = "pepperoni";
this.pepperoni.TabIndex = 1;
this.pepperoni.Text = "Pepperoni";
//
// extraCheese
//
this.extraCheese.Location = new System.Drawing.Point(16, 24);
this.extraCheese.Name = "extraCheese";
this.extraCheese.TabIndex = 0;
this.extraCheese.Text = "Extra Cheese";
//
// placeOrder
//
this.placeOrder.Location = new System.Drawing.Point(8, 312);
this.placeOrder.Name = "placeOrder";
this.placeOrder.Size = new System.Drawing.Size(264, 23);
this.placeOrder.TabIndex = 13;
this.placeOrder.Text = "Place Order";
this.placeOrder.Click += new System.EventHandler(this.placeOrder_Click);
//
// btClear
//
this.btClear.Location = new System.Drawing.Point(312, 312);
this.btClear.Name = "btClear";
this.btClear.Size = new System.Drawing.Size(296, 23);
this.btClear.TabIndex = 14;
this.btClear.Text = "Clear Order";
this.btClear.Click += new System.EventHandler(this.btClear_Click);
//
// groupBoxOrder
//
this.groupBoxOrder.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBoxTotal,
this.textBoxTax,
this.textBoxSubtotal,
this.textBoxToppings,
this.textBoxPizza,
this.lbtotal,
this.lbtax,
this.lbsubtotal,
this.lbtopping,
this.lbpizza});
this.groupBoxOrder.Location = new System.Drawing.Point(448, 152);
this.groupBoxOrder.Name = "groupBoxOrder";
this.groupBoxOrder.Size = new System.Drawing.Size(168, 152);
this.groupBoxOrder.TabIndex = 15;
this.groupBoxOrder.TabStop = false;
this.groupBoxOrder.Text = "Order";
//
// textBoxTotal
//
this.textBoxTotal.Location = new System.Drawing.Point(96, 112);
this.textBoxTotal.Name = "textBoxTotal";
this.textBoxTotal.Size = new System.Drawing.Size(56, 20);
this.textBoxTotal.TabIndex = 9;
this.textBoxTotal.Text = "0.00";
//
// textBoxTax
//
this.textBoxTax.Location = new System.Drawing.Point(96, 88);
this.textBoxTax.Name = "textBoxTax";
this.textBoxTax.Size = new System.Drawing.Size(56, 20);
this.textBoxTax.TabIndex = 8;
this.textBoxTax.Text = "0.00";
//
// textBoxSubtotal
//
this.textBoxSubtotal.Location = new System.Drawing.Point(96, 64);
this.textBoxSubtotal.Name = "textBoxSubtotal";
this.textBoxSubtotal.Size = new System.Drawing.Size(56, 20);
this.textBoxSubtotal.TabIndex = 7;
this.textBoxSubtotal.Text = "0.00";
//
// textBoxToppings
//
this.textBoxToppings.Location = new System.Drawing.Point(96, 40);
this.textBoxToppings.Name = "textBoxToppings";
this.textBoxToppings.Size = new System.Drawing.Size(56, 20);
this.textBoxToppings.TabIndex = 6;
this.textBoxToppings.Text = "0.00";
this.textBoxToppings.TextChanged += new System.EventHandler(this.textBoxToppings_TextChanged);
//
// textBoxPizza
//
this.textBoxPizza.Location = new System.Drawing.Point(96, 16);
this.textBoxPizza.Name = "textBoxPizza";
this.textBoxPizza.Size = new System.Drawing.Size(56, 20);
this.textBoxPizza.TabIndex = 5;
this.textBoxPizza.Text = "0.00";
this.textBoxPizza.TextChanged += new System.EventHandler(this.groupBoxToppings_CheckedChanged);
//
// lbtotal
//
this.lbtotal.Location = new System.Drawing.Point(16, 120);
this.lbtotal.Name = "lbtotal";
this.lbtotal.Size = new System.Drawing.Size(72, 23);
this.lbtotal.TabIndex = 4;
this.lbtotal.Text = "Total:";
//
// lbtax
//
this.lbtax.Location = new System.Drawing.Point(16, 96);
this.lbtax.Name = "lbtax";
this.lbtax.Size = new System.Drawing.Size(72, 23);
this.lbtax.TabIndex = 3;
this.lbtax.Text = "Tax:";
//
// lbsubtotal
//
this.lbsubtotal.Location = new System.Drawing.Point(16, 72);
this.lbsubtotal.Name = "lbsubtotal";
this.lbsubtotal.Size = new System.Drawing.Size(72, 23);
this.lbsubtotal.TabIndex = 2;
this.lbsubtotal.Text = "Subtotal:";
//
// lbtopping
//
this.lbtopping.Location = new System.Drawing.Point(16, 48);
this.lbtopping.Name = "lbtopping";
this.lbtopping.Size = new System.Drawing.Size(72, 23);
this.lbtopping.TabIndex = 1;
this.lbtopping.Text = "Toppings:";
//
// lbpizza
//
this.lbpizza.Location = new System.Drawing.Point(16, 24);
this.lbpizza.Name = "lbpizza";
this.lbpizza.Size = new System.Drawing.Size(72, 23);
this.lbpizza.TabIndex = 0;
this.lbpizza.Text = "Pizza:";
//
// pictureBoxPizza
//
this.pictureBoxPizza.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBoxPizza.Image")));
this.pictureBoxPizza.Location = new System.Drawing.Point(419, 8);
this.pictureBoxPizza.Name = "pictureBoxPizza";
this.pictureBoxPizza.Size = new System.Drawing.Size(200, 136);
this.pictureBoxPizza.TabIndex = 16;
this.pictureBoxPizza.TabStop = false;
//
// PizzaCheckout
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.ClientSize = new System.Drawing.Size(632, 341);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.pictureBoxPizza,
this.groupBoxOrder,
this.btClear,
this.placeOrder,
this.groupBoxToppings,
this.groupBoxSize,
this.textBoxCheque,
this.lbcheque,
this.groupBoxPayment,
this.textBoxAddress,
this.addresslb,
this.dash,
this.textBoxPhone2,
this.textBoxPhone,
this.phone,
this.textBoxName,
this.name});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "PizzaCheckout";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Pizza Checkout";
this.groupBoxPayment.ResumeLayout(false);
this.groupBoxSize.ResumeLayout(false);
this.groupBoxToppings.ResumeLayout(false);
this.groupBoxOrder.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new PizzaCheckout());
}
private void btClear_Click(object sender, System.EventArgs e)
{
double toppings =0;
foreach (RadioButton rb in groupBoxPayment.Controls)
rb.Checked = false;
foreach (RadioButton rb in groupBoxSize.Controls)
rb.Checked = false;
foreach (CheckBox cb in groupBoxToppings.Controls)
cb.Checked = false;
foreach (Control ctrl in this.Controls)
{
if (ctrl.GetType().Name == "TextBox")
ctrl.ResetText();
}
foreach (Control ctrl in groupBoxOrder.Controls)
if (ctrl.GetType().Name == "TextBox")
ctrl.Text = "0.00";
toppings = 0;
UpdateTotals();
radioButtonCash.Checked = true;
}
private void placeOrder_Click(object sender, System.EventArgs e)
{
String str = "";
str = "Sold to: "+textBoxName.Text + " \n";
str += "Address: "+textBoxAddress.Text +"\n";
str += "Telephone: "+textBoxPhone.Text + " - " + textBoxPhone2.Text + "\n\n";
str += "Paid by: ";
// paid by
foreach (RadioButton rb in groupBoxPayment.Controls)
if (rb.Checked==true)
str += rb.Text + " ";
str += textBoxCheque.Text + "\n";
//Pizza size
str += "\nPizza Size: ";
foreach (RadioButton rb in groupBoxSize.Controls)
if (rb.Checked==true)
str += rb.Text + "\n";
//toppings
str += "Toppings:\n";
foreach (CheckBox cb in groupBoxToppings.Controls)
if (cb.Checked==true)
str += " " + cb.Text + "\n";
UpdateTotals();
MessageBox.Show(str,"Order Details...");
}
private void radioButtonCash_CheckedChanged(object sender, System.EventArgs e)
{
if (radioButtonCash.Checked)
{
textBoxCheque.Enabled = false;
textBoxCheque.Text = "";
}
else
textBoxCheque.Enabled = true;
}
private void groupBoxToppings_CheckedChanged(object sender, System.EventArgs e)
{
double toppings =0;
foreach (CheckBox cb in groupBoxToppings.Controls)
if (cb.Checked)
toppings += 0.95;
textBoxToppings.Text = toppings.ToString("#0.00");
UpdateTotals();
}
private void UpdateTotals()
{
double dbl=0;
dbl = Convert.ToDouble(textBoxToppings.Text);
dbl+= Convert.ToDouble(textBoxPizza.Text);
double tax= dbl*0.14;
double dbl2=tax + dbl;
textBoxSubtotal.Text = dbl.ToString("#0.00");
textBoxTax.Text = tax.ToString("#0.00");
dbl += tax;
textBoxTotal.Text = "$" +dbl.ToString("#0.00");
}
private void groupBoxSize_CheckedChanged(object sender, System.EventArgs e)
{
if (radioButtonSmall.Checked)
textBoxPizza.Text = "7.95";
else if (radioButtonMedium.Checked)
textBoxPizza.Text = "11.95";
else if (radioButtonLarge.Checked)
textBoxPizza.Text = "14.95";
else if (radioButtonSupreme.Checked)
textBoxPizza.Text = "18.95";
UpdateTotals();
}
private void textBoxToppings_TextChanged(object sender, System.EventArgs e)
{
}
}
}
|
|
|
|
|
That's funny. Pizza chekcout!
/\ |_ E X E GG
|
|
|
|
|
What do you mean by finding pics? Maybe you want Directory.GetFiles() which you can specify search pattern for image files.
You can use PictureBox control to show images in it, and set its Image property. And use FromFile() method of Image class to set its path.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
|
you are a jack ass y would u put that crap on this site u sh*t head
|
|
|
|
|
ass man wrote:
you are a jack ass
Anyone else notice the irony in that statement?
|
|
|
|
|
There are no failures.. only extended learning opportunities.
|
|
|
|
|
Ok, Are you happy now?
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
|