Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
iam try to make an application in which , i have to do that i have to take a control i don't know what i should taken let it assumed that 'X'. so if i take 'X' control on click that its color should be green and again click on same tool its color should be red.
so plz tell me what tool should i use , how can i solve this problem.

eg. suppose their is a small architecture of colony in which their is flat are there, now we have to book them on click, when we click on flat its color should be green its me its booked, when the again we click the color become red of that flat its mean thee flat is sold. after another person from other see its color should been seen black its means that its not available. after by following steps then i have to connect this to my database. in which we can see which flat is booked, sold, or vacant.
Posted
Updated 18-Aug-12 0:51am
v3
Comments
AmitGajjar 18-Aug-12 5:55am    
HomeWork ?
Ravimcts 18-Aug-12 6:47am    
what sir... HOMEWORK??
AmitGajjar 18-Aug-12 6:55am    
is this work given by your teacher ? Please post your efforts to solve this issue. so people here come to know that what you have done to solve your issue.
Ravimcts 18-Aug-12 7:30am    
no sir its my job work not home work iam try and try but i dn't get the exact thing in mind so that i can solve this problm . sir if u have an answer then help me.
AmitGajjar 18-Aug-12 7:55am    
please check my answer.

There are a large number of ways to do this: the way I would do it is to create a UserControl (called "Flat" perhaps) which contains all the info for a flat, and which is capable of displaying itself. Add a property to say if it is booked or not, and handle teh Click event to change the colour: setting the BackgroundColor property of the control will change it.
 
Share this answer
 
Comments
Ravimcts 18-Aug-12 7:32am    
sir i didn't get u clearly.. can u tell me the steps which can i do
Hi,

I think you can do that using jQuery very easily. you need to create grid of Div tag and then on click of particular Div you can toggle the color from red to green or green to red.

Please visit this[^] link, you will get idea about toggle Div color.

Best of luck

Thanks
-Amit Gajjar
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900