tpanel

How to eliminate the flicker on the right edge of TPaintBox (for example when resizing)

只谈情不闲聊 提交于 2019-12-22 04:56:05
问题 Summarization: Say that I have a TForm and two panels. The panels are aligned alTop and alClient. The alClient panel contains a TPaintBox, whose OnPaint involve drawing codes. The default value of DoubleBuffered on the components are false. During the drawing process, flicker is obvious because the form, the panels all paint their background. Because the form is covered by the panels, it is probably fine to intercept its WM_ERASEBKGND message. If not, one could see flickering on the panels,

How can I display a Delphi form in a panel?

大城市里の小女人 提交于 2019-12-21 23:17:52
问题 I've tried to follow the example of http://docwiki.embarcadero.com/CodeExamples/XE7/en/FMXEmbeddedForm_(Delphi) but I hit my first problem with the children of TCustomForm, which are apparently read only, so I commented that out and put in ArgForm.Parent:= ArgParent; instead, but I still just get an empty screen and can't see the buttons that are in my second form. The code for my main form is: unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System

How to draw on a TPanel

走远了吗. 提交于 2019-12-20 02:29:26
问题 I need to draw on a TPanel, ideally directly so I don't have another component on top of it getting in the way of mousevent-event trapping (I want to draw a little "size-grip" on it). How should I go about doing this? 回答1: To really do it right, you should probably write a descendant class. Override the Paint method to draw the sizing grip, and override the MouseDown , MouseUp , and MouseMove methods to add resizing functionality to the control. I think that's a better solution than trying to

Delphi: How to programmatically adjust visual ordering of components with align = alTop

青春壹個敷衍的年華 提交于 2019-12-18 12:21:09
问题 I've got a form with a number of panels, each of which has Align=alTop, so they stack down nicely from the top of the form. However, I want to dynamically change the appearance order of these panels - i.e, move them up and down. What's the best way of doing this? 回答1: You can easily move a top-aligned panel to the top by setting its Top property to 0 . Do this in reverse requested order (bottom panel first) and you are done. 回答2: Move them the same way you'd move them at design time with the

how to create a TCustomControl that behaves like Tpanel?

会有一股神秘感。 提交于 2019-12-11 07:07:24
问题 how do I create a TCustomControl that will behave like Tpanel? eg MyCustomComponent, that I can drop components in like labels, images etc. 回答1: The trick is this piece of code in TCustomPanel: constructor TCustomPanel.Create(AOwner: TComponent); begin inherited Create(AOwner); ControlStyle := [csAcceptsControls {, ... } ]; //... end; There are many more VCL controls you can descend from that have csAcceptsControls in their ControlStyle property. If you want to do this in your own controls,

Controls on top, like TPanel can do?

纵饮孤独 提交于 2019-12-08 10:17:50
问题 My program is doing a time consuming task, and I would like to display a TImage in the middle of the application window, but it will not stay on top - my VST is always on top. However, when I use a TPanel, it stays on top? How can I make my TImage do that? In fact, a solution that applies to all controls would be splendid :) Thanks! 回答1: You need a windowed control (that is, a control with a window handle, or a "proper" control) to display your message, because a non-windowed control cannot

How to print TPanel contents?

佐手、 提交于 2019-12-07 13:41:52
问题 I have TPanel. On this Panel there is an TImage descendant , few other panels with controls, etc. In fact, picture contains some diagram, while additional panels with labels are created during runtime to provide user with additional info. Recently I was told, that it would be nice, if it was possible to print this panel, and have it on the paper just as it appears in form. Any clues, how to do it? 回答1: I found an old usenet post that provides a solution, by copying the contents of the panel

how do I avoid this unwanted behaviour with Delphi's TSplitter and panels?

ε祈祈猫儿з 提交于 2019-12-06 01:57:22
问题 Included is a small project demonstrating my problem. I have a TPageControl aligned to the main form. On each of two tabsheets I have panels client aligned. On each of those panels I have 2 subpanels and a splitter. The LH panel and splitter is aligned left, the RH panel client-aligned. Basically the problem is interaction between the 2 tabs. To demonstrate: run the program stretch the main form horizontally. Panel 3 will grow move the splitter as far to the right as it will go. Panel 2 will

How to print TPanel contents?

跟風遠走 提交于 2019-12-05 22:02:17
I have TPanel. On this Panel there is an TImage descendant , few other panels with controls, etc. In fact, picture contains some diagram, while additional panels with labels are created during runtime to provide user with additional info. Recently I was told, that it would be nice, if it was possible to print this panel, and have it on the paper just as it appears in form. Any clues, how to do it? I found an old usenet post that provides a solution, by copying the contents of the panel to a bitmap, which can be printed: procedure TFormPrintWindows.ButtonPrintPanelClick(Sender: TObject); var

How to eliminate the flicker on the right edge of TPaintBox (for example when resizing)

亡梦爱人 提交于 2019-12-05 05:29:41
Summarization: Say that I have a TForm and two panels. The panels are aligned alTop and alClient. The alClient panel contains a TPaintBox, whose OnPaint involve drawing codes. The default value of DoubleBuffered on the components are false. During the drawing process, flicker is obvious because the form, the panels all paint their background. Because the form is covered by the panels, it is probably fine to intercept its WM_ERASEBKGND message. If not, one could see flickering on the panels, and flickering on the right edge of the panels when the form is resized, because form paints its