days textbox combobox(in combobox i type uoto 1 to 29)
when i click what number that number to be displayed in the textbox
Regards,
RAO
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 10, 2012, 1:55 PM
The skeleton eventhandlers should be added from the VS designer, not just typed in manually:
private void Form1_Load(object sender, EventArgs e)
{
int[] numbers = new int[29];
for (int i = 0; i < 29; i++) numbers[i] = i + 1;
comboBox1.DataSource = numbers;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int index = comboBox1.SelectedIndex;
if (index == -1) return;
textBox1.Text = (index + 1).ToString();
}
private void comboBox1_TextUpdate(object sender, EventArgs e)
{
textBox1.Text = comboBox1.Text;
}
Satyapriya NayakPosted Jul 10, 2012, 1:48 PM
Make sure the title of question makes sense. "g" does not make sense.
Please elaborate it deep and clearly.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Sum_in_datagridview
{
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}
private void Form5_Load(object sender, EventArgs e)
{
int i;
for (i = 1; i <= 29; i++)
{
comboBox1.Items.Add(i);
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = comboBox1.Text;
}
}
}
Thanks