go to frame

hello,
I'd like to clic a key -> open window, tape a value and clic enter (numeric)
and voilà : I have set new timeframe.
but I don't know how to validate the value with enter key, I don't want to clic on the "go" button.... please, any idea ?
------------------------------------------------------------
try destroyDialog rlMover catch()
global rlMover = rollout rlMover "GO2frame"
(
button butconnect "GO" pos:[2,2]
spinner spX "X " width:90 range:[0,5000,1] type:#integer pos:[55,5]
on spX KeyDOwn evnt do
if evnt.KeyCode == (dotNetClass "System.Windows.Forms.Keys").Enter do
(
sliderTime = spX.value
)
)
createDialog rlMover 160 25
setFocus rlMover.spX
------------------------------------------------------------

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

you need to use

you need to use (dotNetControl "NumericUpDown") if you use keydown event.Thats way not works.

bga

barigazy's picture

use "Return" instead of

use "Return" instead of "Enter"
if (evnt.KeyCode as string) == "Return" do ...
or you can use keyValue like this
if evnt.keyValue == 13 do ...
try this script to see KeyCode or keyValues of keyboard keys

http://www.scriptspot.com/3ds-max/scripts/key-value

bga

titane357's picture

thanks for answer, but

thanks for answer, but unfortunally it don't work for me...
instead I use change value, that's do the trick...
-----------------------------------------------------
(
try destroyDialog rlMover catch()
global rlMover = rollout rlMover " GO2frame"
(
spinner spX ">>> FRAME " width:150 range:[0,5000,1] type:#integer pos:[5,5]
on spX changed val do
(
sliderTime = spX.value
)
)
createDialog rlMover 160 25
setFocus rlMover.spX
)
---------------------------------------------------------

Anubis's picture

hey Titane!

Why you use "changed" event of the spinner
then you have "entered"?
on spX entered do ( ... )

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.