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
Number to be displayed in the textbox
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 10, 2012, 9:48 AM EDT
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
VulpesRank #55 · 29.2K reputationPosted Jul 10, 2012, 9:55 AM EDT
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;
}