Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Computer GraphicsRSS Feeds

Program that displays checkbox like windows

Posted By: Easy Tutor     Category: C++ Programming     Views: 2908

Write a program that displays checkbox like windows.

Code for Program that displays checkbox like windows in C++ Programming

#include<graphics.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include"Win_Mous.cpp"// Needed for mouse & window functions, included in zipvoid main()
{
 int x,y,b,e=1,ok=0;
 G();
 setfillstyle(1,3);
 bar(0,0,639,479);
 Win("Check-Box",100,50,450,400,1);
 checkcircle(200,100);
 checkcircle(200,150);
 checkcircle(200,200);
 checkbox(150,100);
 checkbox(150,150);
 checkbox(150,200);
 setcolor(0);
 outtextxy(240,100,"Option 1");
 outtextxy(240,150,"Option 2");
 outtextxy(240,200,"Option 3");
// outtextxy(150,250,"left button : check & uncheck");
 checkc(200,100,1);
 Button("Ok",240,330,290,350,DRAW);
 showmouse();
 do
 {
     if(kbhit()) {if(getch()==27) e=0;}
     getmouse(&b,&x,&y);
     if((b&1)==1)
     {
         if(x>=240 && x<=290 && y>=330 && y<=350)// ok
         {
            e=0;
         }
         if(x>=150 && x<=160 && y>=100 && y<=110)
         {
             if(ok==0) ok=1;
             elseif(ok==1) ok=0;
             hidemouse();
             setfillstyle(1,7);
             bar(150,100,160,110);
             showmouse();
             while((b&1)==1)
             getmouse(&b,&x,&y);
             hidemouse();
             setfillstyle(1,15);
             bar(150,100,160,110);
             check(150,100,ok);
             showmouse();
         }
         if(x>=150 && x<=160 && y>=150 && y<=160)
         {
             if(ok==0) ok=1;
             elseif(ok==1) ok=0;
             hidemouse();
             check(150,150,ok);
             showmouse();
         }
         if(x>=150 && x<=160 && y>=200 && y<=210)
         {
             if(ok==0) ok=1;
             elseif(ok==1) ok=0;
             hidemouse();
             check(150,200,ok);
             showmouse();
         }
         if(x>=200 && x<=210 && y>=100 && y<=110)
         {
             hidemouse();
             checkc(200,100,1);
             checkc(200,150,0);
             checkc(200,200,0);
             showmouse();
         }
         if(x>=200 && x<=210 && y>=150 && y<=160)
         {
             hidemouse();
             checkc(200,100,0);
             checkc(200,150,1);
             checkc(200,200,0);
             showmouse();
         }
         if(x>=200 && x<=210 && y>=200 && y<=210)
         {
             hidemouse();
             checkc(200,100,0);
             checkc(200,150,0);
             checkc(200,200,1);
             showmouse();
         }
         while((b&1)==1)
         getmouse(&b,&x,&y);
     }
 }while(e);
 hidemouse();
 closegraph();
}
  
Share: 


Didn't find what you were looking for? Find more on Program that displays checkbox like windows Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program that displays checkbox like windows is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!