Il giorno 27/feb/08, alle ore 15:03, Massimo Valle ha scritto:
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
Oltretutto c'e' pure un errore ;-) ma non facciamoci il sangue amaro,
probabilmente non l'ha fatto apposta.
-----------------
Giovanni Gualeni - 3D
|