C++C++11C++14C++17ComponentsIntroduction to C++Learn C++

Learn Basic Components in C++ Builder (QuickLook Part 1)

In this article we will add some quick methods to show how to use basic components in C++ Builder. Most of component properties and methods are same in VCL and FMX projects. If you are a beginner we highly recommend you to watch this Introduction To C++ Windows Development With C++Builder video to understand C++ Builder / RAD Studio IDE interface and some basic mechanisms. This video will help you how to create simple C++ Builder projects. So you can easily adapt these quick looks to your projects.
In these examples below we primarily use FireMonkey components and samples, VCL components are mostly same in most conditions.

Table of Contents

TButton

TButton is a button component allows you to add what your application will do when pressed or not. Methods, properties and events of this component can be found here in VCL or here in FMX form.

Palette window (at the right bottom side of C++ Builder) has all components installed. You can drag Button component from Palette Window under the Standard category.

OnClick Event of Button
The most used action of Button is OnClick event, it is being auto created by using double click on it. Or you can select your button and, go to Events Section of Object Inspector, Double click to OnClick event will generate a procedure, add missing lines inside as below;

TLabel

Used to show text information or variables. A TLabel component (class) shows a text on your forms. When your application runs the user cannot edit this text.

Setting Labels
Labels can not be edited by user directly, you can easily change text of selected label from Text FMX Property (or Caption in VLC Property) in Object Inspector.

TEdit

As same in label you can easily change text of selected Edit from Text FMX and VCL Property in Object Inspector.

TMemo

 It is a multiline text editing control, providing text scrolling, you can use it as a output component like command prompt. To do this you must use Add(” “) method.

Lines of Memos are StringList and it is very easy to load or save a text in it;

close

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He was born in 1974, Eskisehir-Turkey, started coding in college and graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. He worked as a research assistant at the same university for more than 10 years. He received his MSc and PhD degrees from the same department at the same university. Since 2012, he is the founder and CEO of Esenja LLC Company. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics, and Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17Generic ProgrammingLearn C++Templates

What Is A Template In C++?

C++C++17Code SnippetComponentsIteratorsLearn C++

What Are The Boost C++ Libraries?

C++C++17Introduction to C++Learn C++Syntax

Learn Bits and How To Use std::bitset In C++

C++C++17IteratorsLearn C++

How To Use Insert In std::map In Modern C++

Worth reading...
Unicode Strings in C++ On Windows