Not sure why this isn't working. Maxscript help says there is a .focus property that you can set but when I try and set to it I get and error that the property doesn't exist. :/
All I want is for the textbox to lose focus when you hit enter.
Any help would be greatly appreciated.
global Bigley_Dialog
rollout rloutRTTSet "Rollout"
(
label spacer "" pos:[0,20]
dotNetControl textb "TextBox" pos:[10,8] width:172 height:10
on rloutRTTSet open do
(
textb.text = "Some text..."
)
on textb KeyUp e do
( -- File Path Box
if e.KeyCode == e.KeyCode.Enter do
(
textb.focus = false
)
)
)
Bigley_Dialog = newrolloutfloater "Dialog" 232 100
addrollout rloutRTTSet Bigley_Dialog
By
Comments (7)
Comment policy
Such an interesting post in terms of programming languages. I'm familiar in terms of programs and as I reviewed your code, it seems right but as you said, it's not working. Maybe there's something wrong with your software installations.-audio mastering free
Thank you for your informative post!
audio mastering tampa
Teresa Bowen
Got it!
Nice man! Thanks for that!
I ended up using setfocus to just set the focus to another ui element. Originally didn't think it would work on non dotnet controls.
Much appreciated.
Hi Jeremiah
"Maxscript help says there is a .focus property"
- Where did you find this in mxs help?...
Max UI controlls has Not such property. The .NET controlls has
but it's a Method, not Property, and can be used only to set focus (
).
Never mind, Branko post a nice link, but I bother if you'll like to use .NET Forms instead of Max Rollouts, as suggested in that thread.
"All I want is for the textbox to lose focus when you hit enter."
- Try this one then:
I think that you'll get the cheat idea here ;-)
lol should have refreshed the page! Even better Anubis!
Really appreciate that! :D
no prob ;)
Btw, going by memory and I miss something :) using visible:OFF for btnHidden was bad idea. Just "hide" that button by set it pos out of the dialog, for example:
P.S. - .NET controlls are alot more cusomisable but if you not plan something else with .NET TextBox, then you can achieve the same effect with Max EditText control:
Yep. Panayot is right. It's better to use standard mxs TextBox with mxs Rollout for your example. If you want to do something more complex then .net textbox or richTextBox is good solution.
This script is one of example http://www.scriptspot.com/3ds-max/scripts/mono-text-edit.
Also in attachment you can see example for Only Numerical Input (u can use TB as spinner)
Attachments
Look at this thread maybe you can find the answer for your question.
http://forums.cgsociety.org/showthread.php?f=98&t=1070669