Need to define variable count i=count
Becose I need to auto create number of buttons from counter
- SqlCommand cmd = new SqlCommand();
- cmd.CommandText = "SELECT COUNT(*) FROM roba_usluge";
- Int32 count = (Int32)cmd.ExecuteScalar();
- int top = 50;
- int left = 50;
- for (int i = 0; i = count.ToString(); i++)
- {
- Button button = new Button();
- button.Left = left;
- button.Top = top;
- button.Text = (i + 1).ToString();
- this.Controls.Add(button);
- top += button.Height + 2;
- }

Amit GuptaRank #190 · 12.8K reputationPosted Apr 5, 2018, 11:22 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Apr 5, 2018, 10:56 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Apr 5, 2018, 11:04 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Apr 5, 2018, 11:45 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Apr 5, 2018, 12:03 PM EDT
Goran BibicRank #993 · 2K reputationPosted Apr 5, 2018, 11:00 AM EDT
Goran BibicRank #993 · 2K reputationPosted Apr 5, 2018, 11:08 AM EDT
Goran BibicRank #993 · 2K reputationPosted Apr 5, 2018, 11:35 AM EDT
Goran BibicRank #993 · 2K reputationPosted Apr 5, 2018, 12:12 PM EDT