How do I prevent my form from being resized? I don't want it to be maximized (which can be toggled via the property editor), but I don't want anyone to be able to drag-resize it. Am I missing something simple, or does this require a little bit of coding?
I'm using Delphi 2007.
TForm has the property you need. Set
BorderStyle to bsSingle
so that the form doesn't appear to be sizable, and it has the added benefit of actually not being sizable. :-)
You can set the BorderStyle to bsDialog.
Don't forget about the Constraint properties of TForm, i.e. MaxHeight, MinHeight, MaxWidth, MinWidth.
You can set the BorderStyle to bsSingle, too. That will give you a proper top level frame, with icon and everything.
And if you want to get really geeky (i.e. the answers above are better), you can intercept the RESIZE Windows message.
I would go with the Constraints property myself.
Cheers
Set borderstyle to bstoolwindow. The windows will only have a close button and title bar.
Related
I Couldn't find a property or some hack way to block the dock movements of the TdxBar in a TdxBarManager.
I configured the properties in the TdxBar.NotDocking category, this indeed prevent the bar to be docked but it still can be floated around.
im using vcl 2012 1.5
thx in advance.
If you want a static toolbar, just set the TdxBar BorderStyle to bbsNone (it defaults to bbsSingle).
I'm relatively new to programming and my problem is with a TMainMenu on my form.
I researched a lot (a whole lot) of sites for a solution, but haven't found any that solves this exact problem.
The main menu won't resize, not even when I change the fontsize using Screen.MenuFont.Size. I tried setting the Height property in the OnMeasureItem handler, I tried resizing the images and sub-menuitems at both design- and runtime, I even tried capturing Windows' message WMDrawItem and changing it's parameter before passing it on...
The menu items in the component are resized accordingly, but the vertical height of the menubar itself isn't. (the line seen on the picture below cutting through the icons)
Is there an easy solution to this, like setting some well hidden height property somewhere?
Or do I have to rewrite half of delphi's code to achieve my goal?
Help with code examples are appreciated. :-)
Here's an image:
I am using Delphi 7 on a Win7 machine.
The height of the menu bar is a Windows metric setting. Thus it is valid system wide - not only for your application. If at all, it can only be changed via the display settings of Windows itself.
I would recommend to use TActionMainMenuBar instead. It is much more flexible then the TMainMenu.
You can change the font of the menu bar very easy as well.
what becomes of of the
TStatusBar.Simpletext
property while converting a program from VCL to firmonkey ?
Add a TLabel on top of the TStatusBar, set the Align property to alClient. Set the label text property, and there you are.
Fmx components tries to reuse as much as possible from other basic components.
Unfortunately, the help documentation is not very informative.
Study the FMX.ControlsDemo_Sample.
I need to change TBitBtn's back color. Please suggest me the way to change it.
You can't.
You might replace your BitButton to another button component that implements this property.
One simple and quick solution is to replace each of your BitButton with a pair SpeedButton/Panel. Set SpeedButton's Flat property to False; set Panel's BevelInner and BevelOuter to None; and carefully arrange the SpeedButton over the Panel. Then you might change the Panel Color property and it will appear like Button's color has changed. There is some change in functionality, as SpeedButtons can't get Focus; this may prevent its usage for you or might be a premium indeed, test and decide.
I have a TDBEdit that is not enabled and thus not showing the Hint.
What would be the best way to have it display the Hint while staying disabled?
The only thing I can think of is overlaying the TDBEdit with a fully transparent control that has ShowHint set to True and a Hint property set.
Drop your disabled TWinControl (TDBEdit is a TWinControl) onto an enabled TWinControl container (a TPanel for example) and set the TPanel hint to the desired value.