Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
GeneralRe: My vote of 1 Pin
crystal91543-Mar-10 13:17
crystal91543-Mar-10 13:17 
QuestionAplication uninstall fata error Pin
Tridip Bhattacharjee2-Nov-09 1:27
professionalTridip Bhattacharjee2-Nov-09 1:27 
QuestionHow can i dump a datagrame (IP packet) & it's header (IP header & TCP header) ??????????? Pin
3bood.ghzawi2-Nov-09 0:46
3bood.ghzawi2-Nov-09 0:46 
QuestionIs there any libraries which work on usb Pin
Liya Kebede2-Nov-09 0:38
Liya Kebede2-Nov-09 0:38 
AnswerMessage Closed Pin
2-Nov-09 0:55
stancrm2-Nov-09 0:55 
GeneralRe: Is there any libraries which work on usb Pin
Liya Kebede2-Nov-09 0:57
Liya Kebede2-Nov-09 0:57 
QuestionPerformance Issue Pin
Pavan Navali2-Nov-09 0:27
Pavan Navali2-Nov-09 0:27 
QuestionTransferring user input from a textBox of a form to a label of another form Pin
gamer11271-Nov-09 22:54
gamer11271-Nov-09 22:54 
Hi.

I'm creating a small program that can take restaurant menu choices. I have a main form that takes all the user's choices and then another form that takes how many did the user ordered for a particular dish/menu. Now my problem is I can't show the quantity inputted by the user to the main form where i can also show all the menu/dishes that the user has ordered, the quantity of each dish, and the total amount he must pay.

I have a class that gets the quantity but when i try to show it to the main form after entering the quantity, the value is still zero.

How will I show the quantity to the main form after i enter it from another form? I'm thinking of another way but I feel that this solution is possible.


this is the combobox from the main form:
OrderInfo customerChoices = new OrderInfo();

#region Appetizer ComboBox
        private void cmboBoxAppetizer_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (cmboBoxAppetizer.SelectedIndex)
            {
                case 0:
                    {

                        frmQuantity frmQuantity = new frmQuantity();
                        frmQuantity.Show();

                        customerChoices.Appetizer = cmboBoxAppetizer.Text;
                        label1.Text = customerChoices.Quantity
                    }
                    break;
                case 1:
                    {
                        frmQuantity frmQuantity = new frmQuantity();
                        frmQuantity.Show();
                    }
                    break;
                case 2:
                    {
                        frmQuantity frmQuantity = new frmQuantity();
                        frmQuantity.Show();
                    }
                    break;
                default:
                    {
                    }
                    break;
            }
        }
        #endregion 


then this is the form that takes the quantity:
public partial class frmQuantity : Form
    {
        OrderInfo customerChoices = new OrderInfo();

        public frmQuantity()
        {
            InitializeComponent();
        }

        private void txtBoxQuantity_TextChanged(object sender, EventArgs e)
        {
            txtBoxQuantity.MaxLength = Convert.ToInt32(txtBoxQuantity.Text);
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            customerChoices.Quantity = Convert.ToInt32(txtBoxQuantity.Text);
            
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }


and the class that takes the quantity:
class OrderInfo
    {

        int quantity;

        public int Quantity
        {
            get
            {
                return quantity;
            }
            set
            {
                quantity = value;
            }
        }

    }


I didn't include the other code to easily get what i want.
AnswerRe: Transferring user input from a textBox of a form to a label of another form Pin
Christian Graus1-Nov-09 23:00
protectorChristian Graus1-Nov-09 23:00 
GeneralRe: Transferring user input from a textBox of a form to a label of another form Pin
gamer11271-Nov-09 23:10
gamer11271-Nov-09 23:10 
Questioni need help Pin
zez01-Nov-09 20:22
zez01-Nov-09 20:22 
AnswerRe: i need help Pin
Christian Graus1-Nov-09 20:32
protectorChristian Graus1-Nov-09 20:32 
AnswerRe: i need help Pin
Mycroft Holmes1-Nov-09 20:37
professionalMycroft Holmes1-Nov-09 20:37 
GeneralRe: i need help Pin
Christian Graus1-Nov-09 20:45
protectorChristian Graus1-Nov-09 20:45 
GeneralRe: i need help Pin
zez01-Nov-09 20:57
zez01-Nov-09 20:57 
GeneralRe: i need help Pin
Christian Graus1-Nov-09 21:18
protectorChristian Graus1-Nov-09 21:18 
GeneralRe: i need help Pin
zez01-Nov-09 21:35
zez01-Nov-09 21:35 
GeneralRe: i need help Pin
Christian Graus1-Nov-09 21:40
protectorChristian Graus1-Nov-09 21:40 
AnswerRe: i need help Pin
dan!sh 1-Nov-09 20:54
professional dan!sh 1-Nov-09 20:54 
Questionhow to disable BT and WIFI in windows mobile - C# Pin
E_Gold1-Nov-09 19:26
E_Gold1-Nov-09 19:26 
AnswerRe: how to disable BT and WIFI in windows mobile - C# Pin
Christian Graus1-Nov-09 20:01
protectorChristian Graus1-Nov-09 20:01 
GeneralRe: how to disable BT and WIFI in windows mobile - C# Pin
E_Gold1-Nov-09 21:15
E_Gold1-Nov-09 21:15 
GeneralRe: how to disable BT and WIFI in windows mobile - C# Pin
Christian Graus1-Nov-09 21:19
protectorChristian Graus1-Nov-09 21:19 
QuestionReport not load Pin
haleemasher1-Nov-09 18:59
haleemasher1-Nov-09 18:59 
AnswerRe: Report not load Pin
Christian Graus1-Nov-09 19:10
protectorChristian Graus1-Nov-09 19:10 

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.