how to make "yahoo answers" website like paging list control(horizontal list with page nos in boxes style) in C# windows application..
In this type of control i wanna generate list of page nos dynamically..with proper style like hover.
example can also be seen in windows live search results at microsoft website. pl suggest solution for this..
Loading
Scott LyslePosted Nov 16, 2008, 1:55 AM
what you are talking about is done with a style sheet used with the paging control. To do something similar in a windows application you'd have to code the effects. This might get you started;
public Form1()
{
InitializeComponent();
for (int i = 0; i < 10; i++)
{
Button b = new Button();
b.Height = 30;
b.Width = 100;
b.Text = "Button " + i;
b.Name = "Button" + i;
b.Click += new EventHandler(ButtonClicks);
b.MouseHover += new EventHandler(Button_MouseHover);
b.MouseLeave += new EventHandler(Button_MouseLeave);
b.Top = i * 30;
b.Left = 10;
this.Controls.Add(b);
}
}
public void ButtonClicks(object sender, EventArgs e)
{
MessageBox.Show("You clicked on " +
((Button)(sender)).Name.ToString());
}
private void Button_MouseHover(object sender, EventArgs e)
{
((Button)(sender)).Height = 70;
((Button)(sender)).Width = 200;
}
private void Button_MouseLeave(object sender, EventArgs e)
{
((Button)(sender)).Height = 30;
((Button)(sender)).Width = 100;
}