Logo 
Search:

C++ Programming Articles

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

Program of simple windows & buttons

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

Write a program of simple windows & buttons.

Code for Program of simple windows & buttons in C++ Programming

#include <conio.h>
#include<win_mous.cpp>// Needed for mouse & win functions#define OK (x>=170 && x<=210 && y>=290 && y<=310)
#define CANCEL (x>=280 && x<=330 && y>=290 && y<=310)
#define PUSHME (x>=170 && x<=330 && y>=150 && y<=250)
int x,y,b;
void Press(int sx,int sy,int ex,int ey)
{
 hidemouse();
 Button("",sx,sy,ex,ey,PUSH);
 showmouse();
 while(b==1)
 getmouse(&b,&x,&y);
 hidemouse();
 Button("",sx,sy,ex,ey,UNPUSH);
 showmouse();
}
void main()
{
 G();
 setfillstyle(1,3);
 bar(0,0,640,480);
 Win("Windows 98",100,100,430,370,1);
 Button("Ok",170,290,210,310,DRAW);
 Button("Cancel",280,290,330,310,DRAW);
 Button("Push Me",170,150,330,250,DRAW);
 showmouse();
 while(!kbhit())
 {
 getmouse(&b,&x,&y);
 if(b==1)
 {
    if OK
    {
        Press(170,290,210,310);
        break;
    }
    if CANCEL
    {
        Press(280,290,330,310);
        break;
    }
    if PUSHME  Press(170,150,330,250);
 }
 }
 closegraph();
}
  
Share: 


Didn't find what you were looking for? Find more on Program of simple windows & buttons Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program of simple windows & buttons 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!