Dialog based application, Visual Basic Programming

Assignment Help:

Dialog Based Application:

(A) Dialog Based Application to demonstrate Animate Control:

1. Build a dialog based application.

2. Design the dialog as shown.

3. Place 4 command buttons and the Animate Control on the dialog.

4. Using the class wizard can create a control object m_AnimateCtrl of CAnimateCtrl type.

5. Set the caption of the 4 command buttons as stop, play, close & open.

6. Handle the button clicked event for the 4 command buttons.

7. Include the coding as the handler for open the command button

CFileDialog File(TRUE,NULL, ,"(*.AVI)|*.AVI",NULL);

if(File.DoModal() != idok)

return;

m_AnimateCtrl.Open(File.GetPathName());

The handler for the open command button is answerable for opening the AVI file.

The GetPathName() function returns the handle of the AVI file.

8. Type the below coding as handler for the play command button

m_AnimateCtrl.play(0,-1,-1);

The initial parameter of play(), namely 0, represents the beginning of the file. The next parameter -1, tells to play the file till the end. The IIIrd parameter -1, tells to play the file infinitely.

9. Type the below coding as handler for the stop command button

m_AnimateCtrl.Stop();

10. Type the below coding as handler for the close command button

m_AnimateCtrl.Close();

The Close() function eliminates the memory allocated to the CAnimateCtrl object.

11. Construct and then execute the project

12. Click the open command button

In answer to the Modal dialog, the File dialog would be displayed. The files with AVI extension would only be displayed. Select a file name and click OK in the file dialog box.

13. Click the play command button. The chosen file contents would be displayed.

14. Click the stop command button. The chosen file contents display would be stopped

15. Click the close command button.

The chosen file contents would be eliminated from the memory.

(B)Dialog Based Application to Illustrate List Box control:

1. Build up a dialog based application.

2. Design the dialog as shown. Put a list box control and 2 command buttons on the dialog.

3. Using a class wizard add a control variable m_v1 of CListBox type.

4. Type the following in the OnInitDialog() to initialize the list box m_v1.InsertString(-1,"abc"); -1 in the InsertString() function is used to specify the tail of the list. m_v1.AddString("xyz");

The AddString() function sort the contents of the list box automatically.

m_v1.AddDString("def");

5. The GetCurSel() function will return an index of the item selected from the list box.

6. Handle On the SelChange() function for the list box object id m_v1.DeleteString(m_v1.GetCurSel());

The GetCurSel() function will return the handle of the chosen item in the list box. This is used by the Delete String to dynamically delete the contents from the list box.

7. The Handle Button Clicked the event. Type the coding as shown below.

AfxMessageBox(m_v1.GetText(CString&,m_v1.GetCurSel()));

The GetText() function retrieves the chosen item of the list box and the message box displays the chosen item.

8. The Handle button clicked event for the second command button. Type the coding as shown below.

if(m_v1.FindString(-1,"pat") < 0)

m_v1.InsertString(-1,"pat");

The function FindString() search the contents in the list box for the occurrence of the string "pat" given by the second argument. If it is not present then the content is inserted as a tail element in the list box.

(C) Dialog Based Application to Illustrate Combo Box control:

The Combo box is a drop list. We can edit the contents in the combo box. If it is a drop down, we can't edit during the execution. The other category is a simple combo box. By using the combo box you can give data at the design time. Using CTRL ENTER you can complete the data entry in the combo box.

1. Make a dialog based application.

2. Design the dialog as shown.

3. Put a combo box control in the dialog.

4. Put a command button in the dialog.

5. Add a control variable of the type CComboBox for the combo box control. And name the variable as m_v1

6. Handle button clicked the event for the command button. Type the coding as shown below.

AfxMessageBox(m_v1.GetLBText());

The function GetLBText() will return the chosen item in the combo box.


Related Discussions:- Dialog based application

Deleting handlers with class wizard, Deleting Handlers With Class Wizard: ...

Deleting Handlers With Class Wizard: The handler can be deleted by using the class wizard. The class wizard will delete the prototype and message map entry. The user should ma

Loops - VBScript, Using Loops to Repeat Code Looping let you to run a g...

Using Loops to Repeat Code Looping let you to run a group of statements repeatedly. Some loops repeat statements till a condition are False; others repeat statements till a con

Three models for user interface design, THREE MODELS FOR USER INTERFACE DES...

THREE MODELS FOR USER INTERFACE DESIGN   The 3 models for the user interface design are the implementation model, mental model &the manifest model. The Implementation Mod

Mfc classes, THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView ...

THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView are derived from the CObject and they give the majority of the structure and functionality.

Visual processing - visual interface design, Visual Processing: Our mi...

Visual Processing: Our mind groups the things into patterns and this allows us to process the visual information. Understanding and applying how the human mind processes the v

Device context - visual c++, DEVICE CONTEXT The device context provides...

DEVICE CONTEXT The device context provides the essential drawing tools and the platform to draw. It helps to draw the text, shapes, lines etc. To create the device context, the

What is meant by dtd?, Question 1 Design a form based applications using l...

Question 1 Design a form based applications using labels, text boxes, and buttons to perform basic arithmetic operations on integers Question 2 Describe the concept of Except

Develop a university database using ms-access, Question 1 Write about the ...

Question 1 Write about the Visual Basic Application Development Life cycle with a sample Forms development for performing integer arithmetic operations Question 2 Discuss the

Creating an order entry and editing application , Assume you are creating a...

Assume you are creating an order entry and editing application for a book store. An order consists of a product, quantity, total price, payment type including Credit/Debit card acc

Hotel management system, i need to do my final project for my last year bsc...

i need to do my final project for my last year bsc honours degree in Business Information systems. I need to develop a system which is operational for hotel management system. th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd