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
Dipika ShahPosted Jul 14, 2013, 5:52 AM
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?
VulpesPosted Jul 13, 2013, 12:15 PM
Dipika ShahPosted Jul 13, 2013, 9:07 AM
but it select in serial way.
give me other solution if u have and
plz,give me another idea for the selection of seats
VulpesPosted Jul 13, 2013, 8:56 AM
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 ShahPosted Jul 13, 2013, 8:29 AM
VulpesPosted Jul 12, 2013, 5:16 AM
// 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 ShahPosted Jul 12, 2013, 3:16 AM
ans me quickly...
Dipika ShahPosted Jul 11, 2013, 3:30 AM
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.
VulpesPosted Jul 10, 2013, 7:12 PM
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 ShahPosted Jul 10, 2013, 11:54 AM
i have total 150 seats.
how to make function of this green color and gray color seat.
VulpesPosted Jul 10, 2013, 9:52 AM
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 ShahPosted Jul 10, 2013, 9:15 AM
VulpesPosted Jul 10, 2013, 9:12 AM