Questions tagged [vcl]

This tag is used for questions regarding the Visual Component Library used in Borland/CodeGear/Embarcadero Delphi and C++Builder products as well as Python GUI apps. Do not confuse this with the Varnish Configuration Language (VCL). Use the "varnish-vcl" tag for questions related to that product.

Visual Component Library is a visual component-based object-oriented framework tightly integrated with Delphi and C++Builder. It's also available for Python as a GUI framework.

VCL components cover visual and non-visual components like:

  • Windows common controls
  • Database access components
  • Internet connection components

The component approach allows programmers to extend easily the VCL.

Resources:

1590 questions
6
votes
1 answer

Why does TEdit.OnChange trigger when Ctrl+A is pressed?

I am running a Delphi XE7 VCL app on Windows 7. I have observed that the TEdit.OnChange event triggers when Ctrl+A (select all) is pressed. Why is that? I need to reliably trigger the OnChange event only when the text in the TEdit really changes.…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
6
votes
5 answers

let C++Builder/Delphi create TForms at launch, or create manually?

When a TForm is created in Builder (or Delphi) code is added to main to create these forms at application launch: Application->CreateForm( __classid( TxForm), &xForm ); this makes things easier, but is it wise when the applications has 10, 20, 50,…
Gregor Brandt
  • 7,659
  • 38
  • 59
6
votes
3 answers

Avoid that SetFocus raises an Exception

I am working at a huge, legacy source code where several SetFocus is called at many places, but sometimes, the check if the control is visible or enabled is missing. Due to limited time, and the huge amount of source code, I decided that I want to…
Daniel Marschall
  • 3,739
  • 2
  • 28
  • 67
6
votes
3 answers

Delphi windows 7 control panel component

Im looking for a delphi component that looks and functions like the Windows 7 control panel buttons when you "view by category". Anybody know if something like this already exists?
Hardy Le Roux
  • 1,489
  • 4
  • 17
  • 28
6
votes
1 answer

When to use `__fastcall` calling convention

We have a lot of VCL-based applications written in C++. All the VCL methods (under the __published class modifier require the __fastcall calling convention. However, for whatever reason, developers have been adding __fastcall to other non-VCL…
Bizmarck
  • 2,663
  • 2
  • 33
  • 48
6
votes
1 answer

Selection box of composite component not drawn properly

I have a composite component that consists of a TEdit and a TButton (yes, I know about TButtonedEdit) that inherits from TCustomControl. The edit and button are created in its constructor and placed on itself. At designtime the selection box is not…
Stefan Glienke
  • 20,860
  • 2
  • 48
  • 102
6
votes
3 answers

How can I scroll the content of a TFlowPanel?

Delphi implementation of the TFlowPanel control seems to lack an important feature of the C# version, the AutoScroll one. The C# control with AutoWrap= False and AutoScroll=True behave like a horizontal scrollable list of controls. How can i mimic…
Alin Sfetcu
  • 542
  • 6
  • 16
6
votes
6 answers

How to detect when the mouse move away from a TPanel in Delphi 6?

I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it? I need the panel to change colour when the mouse pointer is over it and return to its original…
Snackmoore
  • 905
  • 3
  • 18
  • 32
6
votes
1 answer

How to get a component's parent form in Borland VCL?

I'd like to determine which form a given component belongs to in my application. Neither the Parent nor the Owner property can be assumed to be the form itself, so I can't simply use this. I guess I could just go through the Parent property…
nklein
  • 61
  • 2
6
votes
2 answers

Correct Delphi compiler switches to stop in the user's code, not my component's

I'm modifying our VCL components so the end user's application links to our dcu files, instead of building our source code each time. We have everything working, but I want the debugger to stop on the user's code when an exception is raised. At…
Jeremy Mullin
  • 4,170
  • 4
  • 36
  • 54
6
votes
3 answers

Is there a way to have a KeyPreview-like functionality when working with Frames?

I would like to have a KeyPreview functionality within Frames, I mean, that when the input (say, one of the controls of the frame is selected, or the mouse is inside) is in a frame (which would have several panels and other controls) then the keys…
Rodrigo Gómez
  • 1,079
  • 8
  • 24
6
votes
2 answers

Delphi - How to delete all child components at runtime?

At design time, I create a TScrollBox which will be the parent of TLayouts created at runtime. The Layouts will also contain Tlabels and Tedits like this: var Layout1: TLayout; Label1: TLabel; Edit1: TEdit; begin Layout1 :=…
Alvin Lin
  • 199
  • 2
  • 5
  • 13
6
votes
3 answers

Delphi: How to adjust text vertical position of a TEdit

The text in a TEdit (or TCombo, TButtonedEdit) is always aligned to top. I have not found any property to change the alignment. Usually it is not a problem, unless I want to set a larger height. I googled a little. There are solutions to adjust the…
stanleyxu2005
  • 8,081
  • 14
  • 59
  • 94
6
votes
2 answers

Delphi TFloatField.DisplayFormat for numeric fields less than 1.0

This is my procedure. procedure format_integer_field(Atable: TDataSet); var i: integer; begin if Atable.Active then if Atable.FieldCount > 0 then with Atable do begin for i:= 0 to FieldCount-1 do if (Fields[i] is TIntegerField) then …
Morteza Samie
  • 125
  • 1
  • 1
  • 9
6
votes
3 answers

Delphi Button with Background Image

I have Delphi 7 and now installed Delphi XE2. I'm not really experienced with Design, VCL etc. but I would like to have a button (with Caption!) and a simple background image (PNG). I have 3 pictures of custom buttons (1 for click, 1 for mouseoff…
Ben
  • 3,380
  • 2
  • 44
  • 98