Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
21Activity
0 of .
Results for:
No results containing your search query
P. 1
VC++

VC++

Ratings: (0)|Views: 675 |Likes:
Published by mduli1

More info:

Published by: mduli1 on Jul 07, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/11/2013

pdf

text

original

 
I
(1) ________________________ ________________________________________ ______________________
Q-1 Discuss in detail the use of Dialog Box, Combo Box and check box control in VC++.Ans
Dialog box
is nothing but a special type of window designed to obtain input from the user. There aretwo types of dialog boxes:-Modal & Modeless.
Creating Dialog Boxes Application:-
 1.
 
Open the application.2.
 
Choose Inse
 
rt, Resource from developers studio’s menu bar.3.
 
Resource type dialog box appears.4.
 
Choose dialog & double click it then press ok button.5.
 
Now, Default type of dialog box appears on the project.6.
 
By choosing view, properties.7.
 
Change the caption to dialog example. The ID for this dialog box has been choosen by theapplication wizard is IDD_DIALOG 1.8.
 
By default two command button OK, CANCEL. You may remove these controls by selecting it &pressed delete button through keyboard.
COMBO BOX:-
It is a combination of edit box & list box. This controlenables user to select from the list .There are three types of combo boxes are:- simple, Drop down, Drop down list.
Using of combo box :-
follow these steps1.
 
From the control palette, select combo box control and place it on theDialog window. Its default ID as
IDC_COMBO 1
. However you can change it through the propertydialog box.
2.
 
Open the class wizard select member variables tab to add variable
m_combo 1
of type
CCOMBOBOX.
3.
 
Open the file view & select
Dialog dlg.cpp
. Add the following code shown below:-
These notes are only for guidance purposes and should not be used as substitutes of textbooks. The students are strictlyadvised to study prescribed textbooks comprehensively to develop thorough understanding of the subject.
 
I
(2) ________________________ ________________________________________ ______________________
BOOL
CDialog
Dlg::OnInitDialog()Combo1.AddString("kamini");eturn TRUE; // return TRUE unless you set the focus to a control}4. W selected from this combo box by clicking at the item,
CBN_SELCHANGE
message5.
 
angeCombo1().mGetCurSel(),mm);MessageBox(mm);.
 
Compile & run the application.
ECK BX:-
{
CDialog
::OnInitDialog();//do not change other codesm_Combo1.AddString("manoj");m_Combo1.AddString("anurag");m_Combo1.AddString("kamal");m_Combo1.AddString("pankaj");m_Combo1.AddString("anupam");m_ r hen an item isis generated
 
Here, handler name is OnSelchangeCombo1().Add the following code into the message handler – OnSelchchar mm[20]; //buffer to store the selected item_Combo1c.GetLBText(m_Combo1c. 6 
CHO
Chuse this control to set options on or off; each option can be selected ordeselected independently.Using Check-box Control :-eck Box are small squared in which check marks on orOff. YouFollow these steps are:-1. From the Control palette, select two check control and place it on the dialog window. Thebuttons are placed with their default IDs and captions as
IDC_CHECK1,
 
Check1
and
,
 
These notes are only for guidance purposes and should not be used as substitutes of textbooks. The students are strictlyadvised to study prescribed textbooks comprehensively to develop thorough understanding of the subject.
 
I
(3) ________________________ ________________________________________ ______________________
IDC_CHECK2, Check2
respectively. However, again, you can change them through the property2.-click at the button, a message handler
OnCheck1(), is
 eck button controlto add
OnCheck2()
message handler.3. open the class-wizard and add a member-variable m_Check1c of type CButtondialog box.When the check button is clicked, a corresponding window message
BN_CLICKED
message isgenerated. In order to do so, doublesuggested by the system, is created. Similarly, repeat the same for
Check2
ch MessageBox("You have checked the First Check-box");MessageBox("You have Unchecked the First Check-box");5.
 
Compile an run the application. Click the button to see the output.4.Add the following code into the message handlerif(m_Check1c.GetCheck()==1) // if the box has been checkedelse d
These notes are only for guidance purposes and should not be used as substitutes of textbooks. The students are strictlyadvised to study prescribed textbooks comprehensively to develop thorough understanding of the subject.

Activity (21)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
tarnoscribd liked this
Sumit Kaushik liked this
sethuraja16 liked this
maha_thaeshna liked this
sathya_perumal liked this
tryuva liked this
rocketragu liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->