SlideShare a Scribd company logo
1 of 4
Common DialogControl
CommonDialogControl The commondialogbox invisual basicisan insertable control thatallows
usersto displayanumberof commondialogboxesintheirprogram.
These include OpenandSave Asfile dialogboxes;the FindandReplace editingdialogboxes;the
Print,PrintSetup,PrintPropertySheet,andPage Setupprintingdialogboxes;andthe Colorand Font
dialogboxes
.The easiestwaytoaccess these controlsistouse a componentcalledMicrosoftCommonDialog
Control 6.0. To addthiscomponenttoyour project, choose Project- Components,andmark it inthe
controlslist.Subsequently,anewcontrol shouldappearinyourcontrol toolbox.Choose it,andplace
the control onto yourform (note it'sonlyvisibleindesigntime).
Open and Save dialogs
ShowOpenshowsa dialogthat letsthe userchoose a drive,directory,file name andfile extension
to (presumably) openafile.
The save dialogisidentical inapperance andfunction,withthe exceptionof the caption.
At run time,whenthe userchoosesafile andclosesthe dialogbox,the FileName propertyisused
to getthe selectedfile name.
Before displayingthe dialogBefore youcanuse these dialogs,youmust firstsetthe Filterproperty
to allowthe userto selectafile extension .The filterpropertyisastringwiththe followingstructure:
description1|filter1|description2|filter2|
Here,the descriptionisthe stringthatshowsupin the listbox of all the available filterstochoose
from.
setdefaultextensionusing DefaultExt).
Setdefaultinitial directoryusing initdir
code
COMMONDIALOG1.Filter="textfiles|*.txt|documents|*.doc|allfiles|*.*"
COMMONDIALOG1.FileName="text1"
COMMONDIALOG1.InitDir= "D:"
COMMONDIALOG1.ShowOpen
RICHTEXTBOX1.FileName = COMMONDIALOG1.FileName
Color dialog
The color dialogallowsthe usertoselectacolor fromboth a palette aswell asthroughmanual
choosingusingRGB .
You retrieve the selectedcolorusingthe Colorproperty.
Flags usedin color dialog
Constant Value Description
cdlCCFullOpen &H2 Entire dialog box is displayed, including the Define Custom Colors
section.
cdlCCHelpButton &H8 Causes the dialog box to display a Help button.
cdlCCPreventFullOpen &H4 Disables the Define Custom Colors command button and prevents
the user from defining custom colors.
cdlCCRGBInit &H1 Sets the initial color value for the dialog box.
Sample code
COMMONDIALOG1.Flags= cdlCCFullOpen
COMMONDIALOG1.ShowColor
RICHTEXTBOX1.SelColor= COMMONDIALOG1.color
Font dialog
The Fontdialogbox allowsthe usertoselecta fontby itssize,color,andstyle.
Once the usermakesselectionsinthe Fontdialogbox,the followingpropertiescontaininformation
aboutthe user'sselections.
Color The selectedcolor.
FontBoldReturnswhetherthe boldcheckbox wasselected.
FontItalic Returnswhetherthe italiccheckboxwasselected.
FontStrikethruReturnswhetherthe strikethroughcheckbox wasselected. Touse thisproperty,you
mustfirstset the FlagspropertytocdlCFEffects.
FontUnderline Returnswhetherthe underline checkboxwasselected.
FontName Returns the selectedfontname.
FontSize Returnsthe selectedfontsize.
Before displayingthe dialogTodisplaythe dialog,youmustfirstsetthe Flagspropertyeither
cdlCFScreenFontsorcdlCFPrinterFonts or cdlCFBoth,if youintendtoletthe userchoose between
bothscreenfontsand printerfonts
code
COMMONDIALOG1.Flags= cdlCFBoth+ cdlCFEffects
COMMONDIALOG1.ShowFont
RICHTEXTBOX1.SelFontName = COMMONDIALOG1.FontName
RICHTEXTBOX1.SelFontSize= COMMONDIALOG1.FontSize
RICHTEXTBOX1.SelBold= COMMONDIALOG1.FontBold
RICHTEXTBOX1.SelItalic= COMMONDIALOG1.FontItalic
RICHTEXTBOX1.SelStrikeThru= COMMONDIALOG1.FontStrikethru
Print dialog
The print dialogbox allowsthe usertoselecthow outputshouldbe printed.
Optionsandpropertiesaccessible tothe userincludesthe amountof copiestomake,printquality,
the range of pagesto print,etc.
CopiesThe amountof copiestoprint.
FromPage The startingpage of the printrange.
ToPage The endingpage of the printrange.
hDC The device contextforthe selectedprinter.
OrientationThe page'sorientation(asinportraitor landscape).
Before displayingthe dialogBefore showingthe dialog,feel freetosetthe appropriate printdialog
propertiestosetthe defaultvaluestouse.
Sample code
CommonDialog1.ShowPrinter
BeginPage =CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies=CommonDialog1.Copies
Orientation=CommonDialog1.Orientation
RichTextbox Control
• The rich textbox control allowsthe usertoenterandedittext,providingmore advanced
formattingfeaturesthanthe conventional textboxcontrol. Youcan use differentfontsfordifferent
textsections.
You can evencontrol indents,hangingindents,andbulletedparagraphs. Thiscontrol isloadedby
selectingthe MicrosoftRichTextbox Control fromthe Componentsdialogbox.
Most of the properties,events,andmethodsassociatedwiththe conventionaltextbox are available
withthe rich textbox. A majordifference betweenthe twocontrolsisthatwiththe rich textbox,
multiple fontsizes,styles,andcolorsare supported.
Some unique propertiesof the rich textboxare:
FileName Canbe usedtoload the contentsof a .txt or .rtf file intothe control.
SelFontName Setthe fontname forthe selectedtext.
SelFontSize Setthe fontsize forthe selectedtext.
SelFontColorSetthe fontcolorfor the selectedtext.
selBold,selItalic,setselectedtexttobold,italic
SelStrikeThru
Some unique methodsof the richtextbox are:
LoadFile- Openafile andloadthe contentsintothe control.
SaveFile- Save the control contentsintoafile.

More Related Content

What's hot

Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...Simplilearn
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menukuldeep94
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend classAbhishek Wadhwa
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations Rob LaPlaca
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requireTheCreativedev Blog
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScriptShahDhruv21
 
simple exercises in Macromedia flash 8
simple exercises in Macromedia flash 8simple exercises in Macromedia flash 8
simple exercises in Macromedia flash 8srividhyasowrirajan
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksskomadina
 

What's hot (20)

Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
 
Xml
XmlXml
Xml
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 
Css selectors
Css selectorsCss selectors
Css selectors
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and require
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Event handling
Event handlingEvent handling
Event handling
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
simple exercises in Macromedia flash 8
simple exercises in Macromedia flash 8simple exercises in Macromedia flash 8
simple exercises in Macromedia flash 8
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
 

Viewers also liked

Earth changes quickly
Earth changes quicklyEarth changes quickly
Earth changes quicklyroshanrm
 
Heartside Gleaning Initiative Marketing Plan
Heartside Gleaning Initiative Marketing PlanHeartside Gleaning Initiative Marketing Plan
Heartside Gleaning Initiative Marketing PlanGabrielle Shipley
 
Choice insight series paralympic survey
Choice insight series paralympic surveyChoice insight series paralympic survey
Choice insight series paralympic surveyChoiceInsight
 
13 f a2 media power point2
13 f a2 media power point213 f a2 media power point2
13 f a2 media power point2callison1318
 
Psychological Thriller Poster + Website analysis
Psychological Thriller Poster + Website analysisPsychological Thriller Poster + Website analysis
Psychological Thriller Poster + Website analysisamyhowesmediastudies
 
Asset Manager/ Asset Specialist Roles
Asset Manager/ Asset Specialist RolesAsset Manager/ Asset Specialist Roles
Asset Manager/ Asset Specialist RolesJason (Jake) Davis
 
TDC2016SP - Governança Ágil viabilizando a estratégia de inovação
TDC2016SP - Governança Ágil viabilizando a estratégia de inovaçãoTDC2016SP - Governança Ágil viabilizando a estratégia de inovação
TDC2016SP - Governança Ágil viabilizando a estratégia de inovaçãotdc-globalcode
 
TDC2016SP - Trilha Arquitetura Empresarial
TDC2016SP - Trilha Arquitetura EmpresarialTDC2016SP - Trilha Arquitetura Empresarial
TDC2016SP - Trilha Arquitetura Empresarialtdc-globalcode
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...Roberto Scarafia
 
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...Roberto Scarafia
 

Viewers also liked (18)

Earth changes quickly
Earth changes quicklyEarth changes quickly
Earth changes quickly
 
Heartside Gleaning Initiative Marketing Plan
Heartside Gleaning Initiative Marketing PlanHeartside Gleaning Initiative Marketing Plan
Heartside Gleaning Initiative Marketing Plan
 
Choice insight series paralympic survey
Choice insight series paralympic surveyChoice insight series paralympic survey
Choice insight series paralympic survey
 
13 f a2 media power point2
13 f a2 media power point213 f a2 media power point2
13 f a2 media power point2
 
Psychological Thriller Poster + Website analysis
Psychological Thriller Poster + Website analysisPsychological Thriller Poster + Website analysis
Psychological Thriller Poster + Website analysis
 
Asset Manager/ Asset Specialist Roles
Asset Manager/ Asset Specialist RolesAsset Manager/ Asset Specialist Roles
Asset Manager/ Asset Specialist Roles
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
 
Verotusasiat, alv ja verosuunnittelu mehiläishoidossa
Verotusasiat, alv ja verosuunnittelu mehiläishoidossaVerotusasiat, alv ja verosuunnittelu mehiläishoidossa
Verotusasiat, alv ja verosuunnittelu mehiläishoidossa
 
Signages report
Signages reportSignages report
Signages report
 
Mehiläiset omenan tautien torjujina
Mehiläiset omenan tautien torjujinaMehiläiset omenan tautien torjujina
Mehiläiset omenan tautien torjujina
 
Arrays
ArraysArrays
Arrays
 
TDC2016SP - Governança Ágil viabilizando a estratégia de inovação
TDC2016SP - Governança Ágil viabilizando a estratégia de inovaçãoTDC2016SP - Governança Ágil viabilizando a estratégia de inovação
TDC2016SP - Governança Ágil viabilizando a estratégia de inovação
 
TDC2016SP - Trilha Arquitetura Empresarial
TDC2016SP - Trilha Arquitetura EmpresarialTDC2016SP - Trilha Arquitetura Empresarial
TDC2016SP - Trilha Arquitetura Empresarial
 
Arrays
ArraysArrays
Arrays
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...
1 snsi strategia nazionale di specializzazione intelligente invitalia decrini...
 
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...
20160918 - F. Prefumo - Ecografia, screening biochimico, NIPT e diagnosi pren...
 

Similar to Common DialogControl and RichTextBox in Visual Basic

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
PDF ON JAVA - JFC CONCEPT
PDF ON JAVA - JFC CONCEPTPDF ON JAVA - JFC CONCEPT
PDF ON JAVA - JFC CONCEPTNAVYA RAO
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxAnasYunusa
 
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...Shahzad
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Pantech ProLabs India Pvt Ltd
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programmingsanaiftikhar23
 
dFontographer
dFontographerdFontographer
dFontographerInsforia
 
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLGrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLJean Vanderdonckt
 
Font dialog & link label
Font dialog & link labelFont dialog & link label
Font dialog & link labelchauhankapil
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interfacePeter Horsbøll Møller
 

Similar to Common DialogControl and RichTextBox in Visual Basic (20)

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
PDF ON JAVA - JFC CONCEPT
PDF ON JAVA - JFC CONCEPTPDF ON JAVA - JFC CONCEPT
PDF ON JAVA - JFC CONCEPT
 
Visual basic
Visual basicVisual basic
Visual basic
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programming
 
dFontographer
dFontographerdFontographer
dFontographer
 
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLGrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
 
Ms vb
Ms vbMs vb
Ms vb
 
Dsplab v1
Dsplab v1Dsplab v1
Dsplab v1
 
Debug tool
Debug toolDebug tool
Debug tool
 
Font dialog & link label
Font dialog & link labelFont dialog & link label
Font dialog & link label
 
Guide To Magic Infoforuser
Guide To Magic InfoforuserGuide To Magic Infoforuser
Guide To Magic Infoforuser
 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interface
 

Recently uploaded

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 

Recently uploaded (20)

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 

Common DialogControl and RichTextBox in Visual Basic

  • 1. Common DialogControl CommonDialogControl The commondialogbox invisual basicisan insertable control thatallows usersto displayanumberof commondialogboxesintheirprogram. These include OpenandSave Asfile dialogboxes;the FindandReplace editingdialogboxes;the Print,PrintSetup,PrintPropertySheet,andPage Setupprintingdialogboxes;andthe Colorand Font dialogboxes .The easiestwaytoaccess these controlsistouse a componentcalledMicrosoftCommonDialog Control 6.0. To addthiscomponenttoyour project, choose Project- Components,andmark it inthe controlslist.Subsequently,anewcontrol shouldappearinyourcontrol toolbox.Choose it,andplace the control onto yourform (note it'sonlyvisibleindesigntime). Open and Save dialogs ShowOpenshowsa dialogthat letsthe userchoose a drive,directory,file name andfile extension to (presumably) openafile. The save dialogisidentical inapperance andfunction,withthe exceptionof the caption. At run time,whenthe userchoosesafile andclosesthe dialogbox,the FileName propertyisused to getthe selectedfile name. Before displayingthe dialogBefore youcanuse these dialogs,youmust firstsetthe Filterproperty to allowthe userto selectafile extension .The filterpropertyisastringwiththe followingstructure: description1|filter1|description2|filter2| Here,the descriptionisthe stringthatshowsupin the listbox of all the available filterstochoose from. setdefaultextensionusing DefaultExt). Setdefaultinitial directoryusing initdir code COMMONDIALOG1.Filter="textfiles|*.txt|documents|*.doc|allfiles|*.*" COMMONDIALOG1.FileName="text1" COMMONDIALOG1.InitDir= "D:" COMMONDIALOG1.ShowOpen RICHTEXTBOX1.FileName = COMMONDIALOG1.FileName Color dialog The color dialogallowsthe usertoselectacolor fromboth a palette aswell asthroughmanual choosingusingRGB .
  • 2. You retrieve the selectedcolorusingthe Colorproperty. Flags usedin color dialog Constant Value Description cdlCCFullOpen &H2 Entire dialog box is displayed, including the Define Custom Colors section. cdlCCHelpButton &H8 Causes the dialog box to display a Help button. cdlCCPreventFullOpen &H4 Disables the Define Custom Colors command button and prevents the user from defining custom colors. cdlCCRGBInit &H1 Sets the initial color value for the dialog box. Sample code COMMONDIALOG1.Flags= cdlCCFullOpen COMMONDIALOG1.ShowColor RICHTEXTBOX1.SelColor= COMMONDIALOG1.color Font dialog The Fontdialogbox allowsthe usertoselecta fontby itssize,color,andstyle. Once the usermakesselectionsinthe Fontdialogbox,the followingpropertiescontaininformation aboutthe user'sselections. Color The selectedcolor. FontBoldReturnswhetherthe boldcheckbox wasselected. FontItalic Returnswhetherthe italiccheckboxwasselected. FontStrikethruReturnswhetherthe strikethroughcheckbox wasselected. Touse thisproperty,you mustfirstset the FlagspropertytocdlCFEffects.
  • 3. FontUnderline Returnswhetherthe underline checkboxwasselected. FontName Returns the selectedfontname. FontSize Returnsthe selectedfontsize. Before displayingthe dialogTodisplaythe dialog,youmustfirstsetthe Flagspropertyeither cdlCFScreenFontsorcdlCFPrinterFonts or cdlCFBoth,if youintendtoletthe userchoose between bothscreenfontsand printerfonts code COMMONDIALOG1.Flags= cdlCFBoth+ cdlCFEffects COMMONDIALOG1.ShowFont RICHTEXTBOX1.SelFontName = COMMONDIALOG1.FontName RICHTEXTBOX1.SelFontSize= COMMONDIALOG1.FontSize RICHTEXTBOX1.SelBold= COMMONDIALOG1.FontBold RICHTEXTBOX1.SelItalic= COMMONDIALOG1.FontItalic RICHTEXTBOX1.SelStrikeThru= COMMONDIALOG1.FontStrikethru Print dialog The print dialogbox allowsthe usertoselecthow outputshouldbe printed. Optionsandpropertiesaccessible tothe userincludesthe amountof copiestomake,printquality, the range of pagesto print,etc. CopiesThe amountof copiestoprint. FromPage The startingpage of the printrange. ToPage The endingpage of the printrange. hDC The device contextforthe selectedprinter. OrientationThe page'sorientation(asinportraitor landscape). Before displayingthe dialogBefore showingthe dialog,feel freetosetthe appropriate printdialog propertiestosetthe defaultvaluestouse. Sample code CommonDialog1.ShowPrinter BeginPage =CommonDialog1.FromPage
  • 4. EndPage = CommonDialog1.ToPage NumCopies=CommonDialog1.Copies Orientation=CommonDialog1.Orientation RichTextbox Control • The rich textbox control allowsthe usertoenterandedittext,providingmore advanced formattingfeaturesthanthe conventional textboxcontrol. Youcan use differentfontsfordifferent textsections. You can evencontrol indents,hangingindents,andbulletedparagraphs. Thiscontrol isloadedby selectingthe MicrosoftRichTextbox Control fromthe Componentsdialogbox. Most of the properties,events,andmethodsassociatedwiththe conventionaltextbox are available withthe rich textbox. A majordifference betweenthe twocontrolsisthatwiththe rich textbox, multiple fontsizes,styles,andcolorsare supported. Some unique propertiesof the rich textboxare: FileName Canbe usedtoload the contentsof a .txt or .rtf file intothe control. SelFontName Setthe fontname forthe selectedtext. SelFontSize Setthe fontsize forthe selectedtext. SelFontColorSetthe fontcolorfor the selectedtext. selBold,selItalic,setselectedtexttobold,italic SelStrikeThru Some unique methodsof the richtextbox are: LoadFile- Openafile andloadthe contentsintothe control. SaveFile- Save the control contentsintoafile.