|
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
|
|
|
|
|
|
Hi
I have the following code that parses the PowerPoint presentation and saves the listed types of shapes in the IF condition as an image to the disk.
================================================================
if((objShape.Type ==MsoShapeType.msoPicture) ||
(objShape.Type == MsoShapeType.msoOLEControlObject ) ||
(objShape.Type == MsoShapeType.msoChart) ||
(objShape.Type == MsoShapeType.msoDiagram) ||
(objShape.Type == MsoShapeType.msoTable) ||
(objShape.Type == MsoShapeType.msoCanvas) ||
(objShape.Type == MsoShapeType.msoEmbeddedOLEObject) ||
(objShape.Type == MsoShapeType.msoGroup))
{
objShape.Export(FrmDemoApp.ImageFolder + "\\"+objShape.Name+"-test.emf",PowerPoint.PpShapeFormat.ppShapeFormatJPG,Convert.ToInt32(objShape.Width * 2.5),Convert.ToInt32(objShape.Height * 2.5) ,PowerPoint.PpExportMode.ppScaleToFit);
}
================================================================
The problem is while saving the OLE objects are getting saved with a black background. I just want them to be saved as they showup in PowerPoint but not with a Black Background.
Any help or documentation links that I might have missed would be of great help.
Thanks
Mohammed Ali
|
|
|
|
|
JPG files do not store transparency information, so there must be a background of some kind of you use that file type. I haven't used PowerPoint automation, but maybe there is another file type that will deal with it better, or maybe you can find a method or attribute that will let you specify the background color to use.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
I suggest PING (.png). It uses the full 32-bit range of colors, which includes the alpha channel that can provide a transparent background.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi.
I´m trying to get the com ports info, so my user can check in which port he has his modem(s). Can someone help me with a way to get this info form the system?
thanks
|
|
|
|
|
Hello all...
I have a problem (of course) and I can't seem to find a solution (of course).
Let me describe the problem. I have a GroupBox (VisualShed) which can contain a few PictureBoxes (Carpets). If there are no Carpet's in the VisualShed and I draw a rectangle, the rectangle is visible. So far so good...
But when the VisualShed contains some Carpets and I draw the rectangle again, I only can see the rectangle in the VisualShed on the places where there is no carpet.
Is there a way to bring the drawn rectangle in front of the Carpets?
To make it more clear I have made a screenshot which you can find here:
http://users.pandora.be/bratislava_TJ/screenShot.jpg
The problem (I think) is that I have to use the Graphics object of the GroupBox, because that is where I have to draw the rectangle. I have to be able to draw the rectangle over more than 1 Carpet.
I also tried to draw a rectangle on a Carpet itself (so with the graphics object of a carpet) and even that wouldn't work?!
I have tried different things:
SetStyle(opaque, true);
BringToFront();
I hope someone can help me out here because the problem is driving me
I don't have much experience in C# but I'm learning... I realy want to get this program solved!
Thanks in advance!
GreetZz,
TweeZz.
ps: If the problem doesnt seem clear... You can always ask me for the sourcecode!
At the end everything is going to be OK!
|
|
|
|
|
The problem is that the rectangle is being drawn before the carpets. It's all a matter of order. Draw the carpets first, then draw the rectangle.
If you're looking to owner-draw, handle the Paint event of a control (not all fire it, though) or - if you're deriving from a control - override the OnPaint method. You'll get an initialized Graphics object that you can use. If you need to perform a single paint operation, you can also use Control.CreateGraphics , but this will not be redrawn if the region you painted gets invalidated (that's what the Paint event is for).
For more information on drawing in .NET, see the many examples[^] here on CodeProject.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
It sounds like you have a windowing issue. In essence you have a window (the group box), in which you can draw whatever you want. Then, you set another window on top of that one, showing the picture. So, whatever you drew in the group box window will only be visible where the picture box windows do not cover it.
So, how do you fix it? Generally, problems like this are solved with a custom control. Instead of a group box and some picture boxes, you want a control that draws the images directly to the surface of the main window (maybe the group box). That way, your rectangle can be drawn after the image was drawn, letting you see the complete rectangle.
Before you write your own control though, check to see if there already is one that can do the job you require. (There may be a control that looks and acts differently, but accomplishes the goals of your project.)
John
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Posted in the forums for the benefit of others who may have similar questions.
Hello,
I took a look at the running program, and the code you sent to me (with Anakrino). Now that I see what is really going on, I can present the options you have.
Problem: You have conflicting goals here. First, you want to be able to draw a rectangle on the surface of the parent window which will appear above the carpet images in this window. Second, you have separate windows (controls) appearing on a layer above the parent window, making it impossible to draw above the carpets from the parent layer.
Solution: Change your existing specialized control in the following ways:
1) Do not use separate window controls to display the carpets. Instead, use a new carpet class that contains the needed position and image information, but does no other real work.
2) Handle the Paint behavior of your control, drawing the images in the correct locations and scale. This is the major difference. Since you are drawing the carpets directly to the control's surface, you have complete control of whatever may appear above them.
3) Now come the annoying little bits. You'll need to handle the mousedown, mouseup, and mousemove behavior is a little more elaborate fashion than you are currently. When not in zoom mode, check to see whether the user clicked in a carpet, and then wait to see if they move the mouse before the next mouse-up. If they do, then start a drag operation -- dragging whatever object you like.
4) Have a good look at the several specialized C# controls here on CodeProject. Some of the grid or list controls do several of these things, and can teach you how to handle these tasks well.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi John,
Yesterday I send a few mails with Stewart. In general, he told me to do the same thing. It's all a matter of drawing things in the right order. I use pictureboxes and groupboxes as my controls. Instead I have to right my own and implement paint() methods... Keep track of the different positions and the order I have to draw things... So that is what I'm going to do. I'll look up some _custom controls_ here on codeproject in the hope they will give me some help with that.
So actually the thing I did was bad programming, because I use the common controls that are provided by .NET which do far to much for the things I need. (Due to that I use to much CPU cycles and resources...) I'm glad that I know now that the thing I wanted to do is (as good as) impossible the way I used my different classes.
This is how I interprete your and Stewart's advice... Correct?
So back to work now for the next hmmm 14 hours? =) Thanks again!!
GreetZz,
TweeZz.
// modified
ps: I got an email from Bob Powell with an url... Nice description of my problem... http://www.bobpowell.net/manipulate_graphics.htm
Thank you Mr. Powell!
|
|
|
|
|
PLz tell me tha thow to get the list of all available fonts in system?
Thanx
sorry for my bad English.
|
|
|
|
|
|
Hi,
I looking for a sample where a listview is using.
In the sample I would like :
- add icon,
- add progressbar,
- add combobox,
- add highlight row,
- add sort column,
- add blinking row,
- change colour of row, column or subitem,
- using context menu for each row,
- find idex of an subitem,
- select different views : details, large,list,...
- add tooltip for each row or subitem,
-...
youssef
|
|
|
|
|
You're not looking hard enough, then. Try searching CodeProject or use google. There's plenty of examples out there, though not with everything in that list. My recommendation is to use a third-party library like those from http://www.devexpress.com/[^] or http://www.infragistics.com[^]. Adding all that is a lot more work than you probably think.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|