Setting The Properties Of Controls

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Setting The Properties Of Controls as PDF for free.

More details

  • Words: 307
  • Pages: 10
Computer II: Programming with Visual Basic 6

SETTING THE PROPERTIES

Outline  Name

Property  Convention for Naming Controls  Common Control Properties  Setting the Control Properties

Name Property  Most

important property of a control  Returns the name used in the code to identify an object

Conventions for Naming Controls  Starts

with a three-letter prefix  Keep it short (use shortened form if possible)  Descriptive of the function of the control  Don’t use any spaces (use underscore instead)  Mix small and capital letters

Prefixes for Common Controls

 Form

– frm  Label – lbl 

Command Button – cmd

 Textbox

– txt  Check box – chk  Combo box – cbo  Image – img  Picture Box – pic  Option Button – opt  List box - lst

Example lblMen u txtInp ut

cmdEqu al

Common Control Properties

 Back

Color – sets the background color  Border Style - sets the style of the border for an object  Caption – sets the text to be displayed  Enabled – sets a value that determines whether an object can respond to user generated events

Common Control Properties

 Font

– sets the Font size and style of an object  Fore Color – sets the color of the text  Picture – sets a graphic to be displayed in a control  Text – sets the text to be displayed on a text box (equivalent of the caption)

Setting the Property (Design Time)  Select

the object  Go to the properties window  Look for the property you want to modify on the left column  Modify the settings on the right column

Hands On  Open

your Hands On 1 folder  Open prjCalculator  Change the name property of the controls

Related Documents

Controls
August 2019 42
Controls
November 2019 32
Controls
November 2019 32