I would like to create an iOS App, with a fixed StringGrid. Every cell of this thing should only accept numeric values. For this I want to set the KeyboardType to vktNumberPad...but so far have not found a point of entry for this. Does anyone here have a clue on how to do this?
OK, so following Mikes hint I started to use my own column class.
TNumEditCell = class(TEdit)
end;
TNumberColum = class(TStringcolumn)
private
function CreateCellControl: TStyledControl; override;
end;
And here comes the baffling part:
function TNumberColum.CreateCellControl: TStyledControl;
begin
result := TNumEditCell.Create(Self);
TNumEditCell(result).KeyboardType := vktNumberPad; // <- is undeclared!! What?!
TNumEditCell(result).OnChange := DoTextChanged;
end;
Our good friend the compiler does not know what vktNumberPad
is. Not even if I point him to it with a telephone pole FMX.Types.TVirtualKeyboardType(vktNumberPad)
. I guess I'm doing something wrong :(
Final edit: Indeed I did something wrong, as Peter pointed out. So with the code above and Peters hint everything works. Ummm...how do I finish this question?
With AutoHotkey, any key on your keyboard can be programmed to type any text you desire. You have little programs (called scripts) running in your taskbar which change what a key-press on the keyboard does. They run silently in the background and get your keyboard working for you for a change. Find out where the program looks for your scripts.
When developing forms, a good practice is that when the keyboard is shown we shouldn’t hide the text entries behind it. Instead of that the text entry should raise up while typing.
When developing forms, a good practice is that when the keyboard is shown we shouldn’t hide the text entries behind it. Instead of that the text entry should raise up while typing. This is pretty easy to do in Xamarin Forms, by just adding the entry inside the Scrollview and that’s it.
Compiler doesn't know about vktNumberPad because you aren't addressing it correctly. use : TNumEditCell(result).KeyboardType := TVirtualKeyboardType.vktNumberPad
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With