I am building a simple application which consists of many TLayouts components. I have to make one of the TLayouts invisible so that I can work on other TLayout.
Please help me in this problem
I have to make one of the TLayouts invisible so that I can work on
other TLayout.
To hide a TLayout at Runtime, simply set its Visible property to False.
To make it Visible again, set the same property to True.
To hide a TLayout at DesignTime, simply set its DesignVisible property to False.
Related
I have a problem with a TForm who contain a TMemo. If Autosize is set to True on the TForm, my TForm is halved and then I can size it ...
That's exactly this problem : https://www.youtube.com/watch?v=3eG3kwRgPTo
I'm with Delphi 10.1 Berlin, all is ok with my Delphi XE6.
Did you know how I can fix it ?
Thanks
You have a kind of circular reference in that the child windows are resizing themselves to the parent and the parent resizing itself to the children, and none of them specifying a width. I agree it is odd that adding a TMemo seems to screw things up but like any circular reference it needs to be broken, so either you need to resize the screen programmatically or, as would probably be better in your case, simply size the panels and don't use the align properties of those. I have tried that approach and it works.
Of course this only allows the top or bottom panel to be made invisible - not those in the middle.
I'm trying to remove all indentations on a TreeView in Firemonkey so that a TreeView will display as a flat list regardless of the parent child relationships within the treeview.
I've had a look at the stylebook and there's nothing there that looks like it sets the indentation depth.
Is there an easy way to do this?
There is a way to do this in XE6 (I haven't tested this in XE5 but I assume it's the same). Set up a custom style for your items in your stylebook (or use treeviewitemstyle if you want this to apply to all treeviews), add a TLayout (or any control) as a child of the style, give it a StyleName of "expander", set the Visible property to False and make the width of 0. Apply and close the style designer, then set the StyleLookup of all your TreeViewItems to your custom style and the indent will disappear.
I need to have two TToolBars on the right side of my main form, so I put three TPanels for alignment, and then put the TToolBars inside them. I've been trying to tell the toolbuttons to have the same width for the past day, to no avail. Here's a screen shot of what I've got:
I found out that if ShowCaption is set to True, the toolbars calculate the button width automatically. My question is why, and how to disable this?
Take a look at this approach:
Set Autosize to False for all buttons.
Call the following inside Form’s OnCreate event: SendMessage(ToolBar3.Handle,TB_SETBUTTONWIDTH, 0, MAKELPARAM(0, <DEFAULT_WIDTH_THAT_YOU_WANT_TO_SET>));
Make sure you do not alter the Visible property of any buttons before the above call – as it will fail for those buttons that are not visible.
Also, ensure you have “CommCtrl” in the uses list for TB_SETBUTTONWIDTH message.
For more details: http://zarko-gajic.iz.hr/ttoolbars-ttoolbutton-autosize-width-issues-empty-caption/
You can use object inspector to set the button width with static value, or you can use formcreate or onpaint or onresize etc to set the value dynamically........
I removed caption bar of my window so now it only has a border around it. I don't want to set BorderStyle to bsNone but I want to remove border. How can I do it?
let me explain more. I want to make sth like Photoshop GUI. If I set border style to bsNone, I'll lose lots of features on win7. I tried to use GraphicControls instead of Form Caption bar to move the window (by handling WMNCHitTest message). It works but double click doesn't maximize and restore the window when border style is bsNone but everything works well when it is bsResizable. I want to set BorderStyle to bsResizable but I want to remove the border like when it is bsNone
You can set the form's border to bsNone and then add a panel to the form. Set the panel's align property to alClient and adjust its border however you like. You have control over the inner and outer bevels and their widths to a 1 pixel granularity. Since Panel1 is a container, it should be easy to just drag everything onto it as though it were the form itself. In the designer, it would be nearly invisible.
If you are not familiar with it, you can drag all the controls from one container to another using the structure view (it's called the object treeview in older versions). This makes it so you don't have to redesign your form to do this. If the panel itself is a problem, you can always just send it to the back and leave all the other controls on the form. It will look exactly the same, but then the controls maintain a TForm parent instead of a TPanel parent. It's just a little extra thing to maintain in the designer.
Having said that, I also recommend considering Mason's comment about nonstandard UIs.
Setting the borderstyle to "bsSizeToolWin" isn't an option? It would be a thinner border, but it would be resizeable and it's still conform the Windows standard...
I haven't seen latest Photoshop, but I guess you need something like that: http://delphihaven.wordpress.com/2010/04/22/setting-up-a-custom-title-bar-reprise/
I'm using Delphi 2007 for Win32 and need to set the vertical scrollbar in TstringGrid to always be visible. How do you do that?
You can hide scrollbars with the Scrollbar property set to either ssNone, ssHorizontal, ssVertical, even when the number of rows and / or columns would normally make them appear.
You can however not force one or both scrollbars to be always visible but disabled, without creating a new descendent class and overriding methods. Unfortunately the standard grid controls have not evolved much since the days of Delphi 1, so your best bet is using some third party grid control instead. Preferably one that does also show proper proportional scroll thumbs.
There is a scrollbar property that can be set to ssNone, ssHorizontal, ssVertical or ssBoth.