vcl

How do I set my MainForm to be hidden when my program starts?

Hello. I am using the Borland c++ builder. I have an application where I want the main form to be hidden until a button is pressed on a different form. i have set the Visible value on the mainform to false, but it still shows up when i run the program. anyone know what to do? ...

TListView performance issues

Hi, I tried to use a TListView component to display rather large data lists (like 4000 rows large), and creating the list is incredibly slow - it takes something like 2-3 secs, which makes the UI all laggy and close to unusable. I fill the TListView.Items inside a BeginUpdate/EndUpdate block, with only preallocated strings - I mean : I...

User defined component - how to set tooltip on Component Palette?

So, I created a new component, derived from an existing TControl type. When I installed it, it appeared on the Component Palette (is that what it's called) at the top of Delphi at design time, to allow me to add it to a form. How do I change its tooltip text -the one that shows if I hover over the Component Palette at deign time? ...

How to code a property editor for integer with min/max values?

Edit: original question below, but I revise it now that I have some code to post.... I am created an editbox which only accepts an integer as input. I didn't use a TMaskEDit because I want to derive a bunch of others from it (only accepts float, and both float & integer with min/max properties). Here's my code. I think the problem is t...

What are csClickEvents and csCaptureMouse exactly?

I'm trying to understand the ControlStyle property in Delphi 2007, but I'm having trouble grasping the csClickEvents and csCaptureMouse attributes. According to specifications, csCaptureMouse makes the control capture mouse events when it is clicked, whereas csClickEvents enables the control to receive and answer to mouse clicks. It als...

How to register a component and property editor at run-time?

After much searching, it looks like I have to assign RegisterComponentsProc and RegisterPropertyEditorProc, which I have done. However, I thought that I could call my design time Register function, i.e. <myComponentUnit>.Register();. When I do I get stack overflow, because, well ... procedure myComponentUnit.Regiter; begin Registe...

WinDirStat-like control in Delphi

The program WinDirStats (written in C++, see http://sourceforge.net/projects/windirstat/ ) has at the top a control that combines a tree-like structure (The column "Name", first on the left) with other types of data (graphic bar in column "Subtree percentage") and other text columns. My question is, using Delphi 7, which control should ...

Stop OK button from closing dialog in delphi

I have a dialog with some fields in it. The user is suppose to fix the form which will later on be parsed. When the user presses ok, the data goes to the database if the checks are successful, if not a warning should be shown and the data dialog should stay. Something like shown below: procedure TDataSaver.OKBtnClick(Sender: TObject); b...

How to check if stored procedure returned a field

I'm using some asp net stored procedures and I do not want edit them. The trouble is when ThisProcedure returns no Field I need. Query->FieldByName("RoleName") // delphi : Query.FieldByName("RoleName") (for TAG %D) and sometimes it works, sometimes I've got error : CommandText does not return a return set I can't avoid it using try c...

How can I check if my application has focus?

What I want to do is check if my application has focus because if it is not then I will popup an Alert Window just over the Notification Area to display some message to the end user. ...

How can I programmatically save event handler and then set it in C++ Builder?

I need to temporary remove TFrame's OnExit and OnEnter events, so I'm trying to do following: declare FEnterHandler and FExit Handler: private: // ... TControl *FParentControl; (__fastcall *(__closure)(TObject*))(TObject*) FEnterHandler; (__fastcall *(__closure)(TObject*))(TObject*) FExitHandler; // ... and I inte...

What is called after Loaded() in Delphi

I have some code that does some setup of internal objects in the Loaded() function. However, some external objects are not completely created yet, but are AFTER the Loaded() function is complete. What function does Delphi call after it calls Loaded()? Better yet what is the creation sequence of a component? Basically I have a TCP Ser...

"specific to a platform" warning in Delphi 6 on Windows 7

We have some legacy code that compiles in Delphi 6. There are plans to rewrite it in a more current IDE, but they are a ways out. When we compile it we get several warnings like this: FPrecision is specific to a platform. This is in VCL\DB.pas. (Not our file.) FPrecision is defined like this: FPrecision Integer Platform I can see...

Closing 2 secondery delphi forms with 'caFree' causes the Main Form to lose focus

Showing 2 secondary forms from the main form and then closing both forms will cause the main form to lose focus. (another application gets activated instead of mine) The secondary forms are created either by the Main Form directly or by creating the third form from the second form. The secondary forms set caFree in the OnClose event: ...

Can I step into the VCL (Pascal) code while debugging a C++ app?

I have a Delphi app that we're migrating to C++. One thing I often do while debugging my Delphi code is step into the VCL itself to understand exactly what's going on, to track some bugs. Is this possible in C++Builder? Suppose I am in C++Builder and I call "ShowMessage". Can I step into that call in my debugging session and switch to P...

Collections with component references and form inheritance

Some time ago I developed a component that had TCollection descendant property and items from this collection contained referenced to the controls on the form. Everything was ok with this component except for inheritance. I don't know about the latest versions of Delphi, but with older ones when a collection is inherited there were two v...

Why does TDataModule not execute actions when I hit shortcut?

Shortcut-handling module of my application contains some sort of 'global' hotkeys, that are linked to their own actions in action list in TDataModule. I did so, because it is part of shortcut persistence and editing system I have. So, any TAction I add into some form/frame/datamodule of my application will be processed and viewed in sho...

Using ROWTYPE input parameters in TADOStoredProc

We have a stored procedure which I'd like to call from my client: PROCEDURE p_my_proc(p_id IN my_table.id%TYPE, p_record IN my_table%ROWTYPE); In the client I want to call this procedure using TADOStoredProc, but haven't found a way to assign the record to a parameter. I have a TDataSet with the record in i...

Delphi windows 7 control panel component

Hi, 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? ...

How can I reduce PageControl flicker in Delphi?

In Delphi 2009 I found that the flicker of a PageControl - which occurs during resizing of the form - can be reduced by setting its DoubleBuffered property to true. However if I add controls to the PageControl tabsheets, they will flicker regardless of their DoubleBuffered property setting. I have also tried with and without runtime the...