C
C#2y ago
Basim

❔ User control form

i have made a user control form with a button in it and now i want this same button to open different form(each different form is a different cinema theatre )
6 Replies
Basim
BasimOP2y ago
StreamReader read = new StreamReader(@"C:\Users\musht\source\repos\WinFormsApp2\Movies.txt"); int count = int.Parse(read.ReadLine()); for (int i = 0; i < count; i++) { var button = (Button)sender; button.Tag = i; var identifier = (int)button.Tag; var form = new BookTime(identifier); form.ShowDialog();
} i have this code in my book click event count is the number of movies form.ShowDialog(); this here shows 3 different cinema theatre but it opens 3 times when i press book once instead it should assign the 1st theatre to the first book button 2nd to the 2nd book button and so on
MasterSubarashii
are buttons hard-coded? or created on login
Basim
BasimOP2y ago
the button is made on the user control form
Basim
BasimOP2y ago
Basim
BasimOP2y ago
this is what it looks like this user control is in a for loop thats why it shows multiple times with differnt lable
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server