.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

รับค่าจาก ComboBox ได้ได้ไร Options · View
47113774
Posted: Tuesday, July 01, 2008 9:19:16 PM
Rank: มือสมัครเล่น
Groups: Member

Joined: 6/22/2008
Posts: 15
Location: Thailand

ComboBox ของผม มี Item ดังนี้ครับ
5 วินาที
10 วินาที
20 วินาที
ไม่ทราบว่าเราจะแยกส่วนของ ตัวเลขเพื่อใช้ในการคำนวณ จากข้อความว่า วินาทีได้อย่างไร



ช่วยหน่อยนะครับ

mocking1
Posted: Wednesday, July 02, 2008 5:13:44 PM
Rank: มือสมัครเล่น
Groups: Member

Joined: 6/26/2008
Posts: 16
Location: thailand

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == 0)
            {
                MessageBox.Show("5 วินาที");
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                MessageBox.Show("10 วินาที");
            }
            else if (comboBox1.SelectedIndex == 2)
            {
                MessageBox.Show("15 วินาที");
            }
        }

 

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by