On 27/feb/08, at 12:03, Lucio Liberi wrote:
FATTO!
dotpos=InStr(me.text,".")
if dotpos <> 0 then
MsgBox "Attenzione, inserire la virgola come separatore dei
decimali!"
'me.text=""
me.text=replace(me.Text,".",",")
me.SelStart=dotpos <<<<<----------------------- la
magia sta tutta qui....
else
App.ResetResult()
end if
Però mi domando cosa rispondo a fare alle tue domande. Se guardavi il
mio esempio nel tuo post relativo ai numeri decimali trovavi questo:
Function KeyDown(Key As String) As Boolean
if key = "." then
dim insertionPoint as integer = me.selStart
if instr(me.text, ",") = 0 then
me.text = left(me.text, insertionPoint) + "," + mid(me.text,
insertionPoint+1)
me.selStart = insertionPoint+1
end if
return true
end if
End Function
Significa che non lo hai nemmeno provato.
Massimo Valle
|