i develop movie multiplex application in that i have 2 category of class exclusive and special class.
when i choose exclusive class the seat images are change in green color seat and the special class image are change in gray color.
it is very tough to me to genrate picturebox click event.
so,how to make function of this.
Loading

VulpesRank #55 · 29.2K reputationPosted Jul 10, 2013, 5:12 AM EDT
Dipika Shah102 reputationPosted Jul 10, 2013, 5:15 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 10, 2013, 5:52 AM EDT
If you want to call this programatically, rather than having the user click the picturebox, then you can do so by just providing the appropriate arguments to the handler.
The first argument 'object sender' is easy - just pass the picturebox reference itself.
The second argument 'EventArgs e' is not so obvious but the value EventArgs.Empty is harmless so I'd use that.
Dipika Shah102 reputationPosted Jul 10, 2013, 7:54 AM EDT
i have total 150 seats.
how to make function of this green color and gray color seat.
VulpesRank #55 · 29.2K reputationPosted Jul 10, 2013, 3:12 PM EDT
However, if that's not the case, you'll need to tell me a lot more about the code you already have.
I'd imagine that you'll have:
1. An array of 150 pictureboxes to represent the seats.
2. A corresponding array recording the current class of seat (exclusive, special or normal).
3. Three images of the seats in white, green and gray.
4. A single Click handler shared by all the pictureboxes.
However, perhaps you could confirm this and also let me know how you determine which class a particular seat belongs to.
Dipika Shah102 reputationPosted Jul 10, 2013, 11:30 PM EDT
i confirm that now i explain u briefly,
i use combobox control for the class(exclusive,special,normal) and use one textbox for no.of ticket. the value of ticket given by user.
when user select exclusive class and no.of ticket 2(or any number(1 to 10)) then seat panel visible and only selected in exclusive seat which seat picturebox become green seat picturebox and other class(special,normal) seat picturebox change gray color seat(mean u can not choose it.) same way special and normal.
Dipika Shah102 reputationPosted Jul 11, 2013, 11:16 PM EDT
ans me quickly...
VulpesRank #55 · 29.2K reputationPosted Jul 12, 2013, 1:16 AM EDT
// put this at form level
static Random rand = new Random();
// within some method
int seatNumber = rand.Next(1, 151); // note needs to be one more than upper limit
EDIT: Sorry GetNext should be just Next
Dipika Shah102 reputationPosted Jul 13, 2013, 4:29 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 13, 2013, 4:56 AM EDT
So what's not working?
If it's producing a seat that's already been taken, then you need to keep calling Next() until you get an unoccupied seat.
Dipika Shah102 reputationPosted Jul 13, 2013, 5:07 AM EDT
but it select in serial way.
give me other solution if u have and
plz,give me another idea for the selection of seats
VulpesRank #55 · 29.2K reputationPosted Jul 13, 2013, 8:15 AM EDT
Dipika Shah102 reputationPosted Jul 14, 2013, 1:52 AM EDT
now the random number is work. and
yes, i was used textbox for no.of ticket and Button for proceed the calculating total ticket and payment.this is done by me.
but, the problem is that when user put value on textbox and click on proceed button the seats panel is visible and user select the no.of seat which values are put in textbox.
so, how to write function of this application?