SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2EPAM Systems
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state managementpriya Nithya
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netJaya Kumari
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Elizabeth alexander
 
Error handling and debugging in vb
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vbSalim M
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Ankit Gupta
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An IntroductionManvendra Singh
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training Moutasm Tamimi
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.netDeep Patel
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC ArchitecturePrem Sanil
 

Was ist angesagt? (20)

Applets
AppletsApplets
Applets
 
Chapter 12 user interface design
Chapter 12 user interface designChapter 12 user interface design
Chapter 12 user interface design
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
Error handling and debugging in vb
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vb
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
VB PPT by ADI PART3.pdf
VB PPT by ADI PART3.pdfVB PPT by ADI PART3.pdf
VB PPT by ADI PART3.pdf
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
 
Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Callback Function
Callback FunctionCallback Function
Callback Function
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
 
html-table
html-tablehtml-table
html-table
 

Andere mochten auch

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
 

Andere mochten auch (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...
 

Ähnlich wie 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
 

Ähnlich wie 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
 
Controls events
Controls eventsControls events
Controls events
 
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
 

Kürzlich hochgeladen

Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 

Kürzlich hochgeladen (20)

Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 

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.