Click here to Skip to main content
15,921,716 members
Home / Discussions / C#
   

C#

 
GeneralRe: Insert statment for multiple tables Pin
falles0129-Aug-07 16:55
falles0129-Aug-07 16:55 
QuestionXML Attributes Pin
ytubis29-Aug-07 12:14
ytubis29-Aug-07 12:14 
AnswerRe: XML Attributes Pin
PIEBALDconsult29-Aug-07 13:17
mvePIEBALDconsult29-Aug-07 13:17 
AnswerRe: XML Attributes Pin
Spacix One29-Aug-07 15:07
Spacix One29-Aug-07 15:07 
GeneralRe: XML Attributes Pin
ytubis29-Aug-07 19:54
ytubis29-Aug-07 19:54 
AnswerRe: XML Attributes Pin
Spacix One30-Aug-07 3:16
Spacix One30-Aug-07 3:16 
QuestionCreate Dynamic Buttons with EvenHandler C# Pin
I Believe In GOD29-Aug-07 10:39
I Believe In GOD29-Aug-07 10:39 
AnswerRe: Create Dynamic Buttons with EvenHandler C# [modified] Pin
Spacix One29-Aug-07 11:49
Spacix One29-Aug-07 11:49 
build the buttons into an array of buttons?

I think you can do this...

Button[] bs = new Button[10];
for (int x = 0; x < 10; x++)
{
    bs[x] = new Button();
    bs[i].ImageList = imageList1;
    bs[x].ImageIndex = x;
    bs[x].Size = new Size(17, 17);
    bs[x].Location = new Point(x * 17, 0);
    bs[x].Visible = true;
    bs[x].Click += new EventHandler(bs_Click);
    Controls.Add (bs);
}
private void bs_Click(object sender, System.EventArgs e)
{
    Console.WriteLine ("The Button I pressed is {0}", sender.ToString().Split(',')[0].Split('.')[4]);
}


edit: to draw 50 in 5 rows of 10 stagger the array
Button[] bs = new Button[50];
for (int y = 0; y < 5; y++)
{
    for (int x = 0; x < 10; x++)
    {
        bs[x] = new Button();
        bs[i].ImageList = imageList1;
        bs[x].ImageIndex = x;
        bs[x].Size = new Size(17, 17);
        bs[x].Location = new Point(x * 17, y * 17);
        bs[x].Visible = true;
        bs[x].Click += new EventHandler(bs_Click);
        Controls.Add(bs);
    }
}




-- modified at 17:54 Wednesday 29th August, 2007


-Spacix
All your skynet questions[^] belong to solved

GeneralRe: Create Dynamic Buttons with EvenHandler C# Pin
I Believe In GOD30-Aug-07 0:13
I Believe In GOD30-Aug-07 0:13 
AnswerRe: Create Dynamic Buttons with EvenHandler C# Pin
BoneSoft29-Aug-07 12:20
BoneSoft29-Aug-07 12:20 
AnswerRe: Create Dynamic Buttons with EvenHandler C# Pin
PIEBALDconsult29-Aug-07 13:19
mvePIEBALDconsult29-Aug-07 13:19 
AnswerRe: Create Dynamic Buttons with EvenHandler C# Pin
Not Active29-Aug-07 17:44
mentorNot Active29-Aug-07 17:44 
GeneralRe: Create Dynamic Buttons with EvenHandler C# Pin
I Believe In GOD30-Aug-07 0:21
I Believe In GOD30-Aug-07 0:21 
GeneralRe: Create Dynamic Buttons with EvenHandler C# Pin
Not Active30-Aug-07 2:10
mentorNot Active30-Aug-07 2:10 
QuestionDetermine Double-Click / Middle Click using low-level mouse hook? Pin
wienzzz29-Aug-07 9:47
wienzzz29-Aug-07 9:47 
AnswerRe: Determine Double-Click / Middle Click using low-level mouse hook? Pin
xfitr229-Aug-07 16:42
xfitr229-Aug-07 16:42 
GeneralRe: Determine Double-Click / Middle Click using low-level mouse hook? Pin
wienzzz29-Aug-07 19:11
wienzzz29-Aug-07 19:11 
GeneralRe: Determine Double-Click / Middle Click using low-level mouse hook? Pin
wienzzz29-Aug-07 19:38
wienzzz29-Aug-07 19:38 
QuestionHow do I write XML into XMLDocument? Pin
oceanexplorer29-Aug-07 9:40
oceanexplorer29-Aug-07 9:40 
AnswerRe: How do I write XML into XMLDocument? Pin
pmarfleet29-Aug-07 11:56
pmarfleet29-Aug-07 11:56 
AnswerRe: How do I write XML into XMLDocument? Pin
Spacix One29-Aug-07 12:01
Spacix One29-Aug-07 12:01 
QuestionModal Window in Smart Parts Pin
umashankergr829-Aug-07 9:22
umashankergr829-Aug-07 9:22 
AnswerRe: Modal Window in Smart Parts Pin
Michael Sync29-Aug-07 17:40
Michael Sync29-Aug-07 17:40 
GeneralRe: Modal Window in Smart Parts Pin
Alaric_30-Aug-07 2:21
professionalAlaric_30-Aug-07 2:21 
GeneralRe: Modal Window in Smart Parts Pin
Michael Sync30-Aug-07 5:00
Michael Sync30-Aug-07 5:00 

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.