Is there a way to set the keyboard type when entering a value in a StringGrid?

I would like to create an iOS application with a fixed StringGrid. Each cell of this thing should take only numerical values. For this, I want to set KeyboardType to vktNumberPad ... but have not yet found an entry point for this. Does anyone know how to do this?

OK, so, following Micks hints, I started using my own column class.

TNumEditCell = class(TEdit) end; TNumberColum = class(TStringcolumn) private function CreateCellControl: TStyledControl; override; end; 

And this incomprehensible 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 . Even if I point it at it using the telephone column FMX.Types.TVirtualKeyboardType(vktNumberPad) . I think I'm doing something wrong :(

Final editing: indeed, I did something wrong as Peter pointed out. So, with the code above, and Peters hints that everything works. Ummm ... how do I end this question?

+6
source share
1 answer

The compiler does not know about vktNumberPad because you are not accessing it correctly. usage: TNumEditCell(result).KeyboardType := TVirtualKeyboardType.vktNumberPad

+2
source

Source: https://habr.com/ru/post/947521/


All Articles