During the years I have written a couple of programs which contain a couple of TSpinEdit and TFloatSpinEdits. Mostly the 2 little arrow buttons made no sense so until Lazarus 1.6.2 it was no problem to hide them by the following code:
// In Lazarus 1.6.2 and older you don't see the 2 arrow buttons and because of this the input fields are smaller.
// In Lazarus 1.8.0 and newer you don't see the 2 arrow buttons but the input fields are more wide.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin;
type
TForm1 = class(TForm)
SpinEdit1: TSpinEdit;
FloatSpinEdit1: TFloatSpinEdit;
procedure FormActivate(Sender: TObject);
private
public
end;
var Form1: TForm1;
implementation
uses windows,Win32Proc;
{$R *.lfm}
procedure TForm1.FormActivate(Sender: TObject);
{disable the 2 arrow buttons of T[Float]SpinEdit}
begin
windows.ShowWindow(Win32Proc.GetWin32WindowInfo(
SpinEdit1.Handle)^.UpDown, SW_HIDE);
windows.ShowWindow(Win32Proc.GetWin32WindowInfo(
FloatSpinEdit1.Handle)^.UpDown, SW_HIDE);
end;
end.
But in Lazarus 1.8.0 and 1.8.4 this solution does not work satisfying. Although the 2 arrow buttons are not visible, their space is drawn white (see attached screenshot):
a) this hides a part of the control, which is right to the T[Float]SpinEdit (so I would have to redisign all my old programs)
b) in this additionally white space you cannot enter a number. I entered "1234567890", which scrolled left automatically, keeping the additionally space empty (this looks curious).
Does somebody know a solution for Lazarus 1.8.4, that the additionally white space is not drawn?
What I do not want is to use TEdit, because it's to much trouble to handle MinValue and MaxValue and converting strings to numbers (with error handling) and vice versa.
I'm using Lazarus 1.8.4 on Windows 7 32 bit. Thanks a lot in advance.