Notifications
Clear all
[Closed] dotnet focus
Apr 16, 2015 11:40 pm
How come when I click in the input field and being typing it doesn’t appear to actually set focus? I’m assuming its because i have dotnet controls inside other dotnet controls. How do i fix this?
try(destroyDialog ::nameTagToolRO)catch()
rollout nameTagToolRO "NameTag Tool"
(
local tabStyle = dotNetClass "System.Windows.Forms.TabAppearance"
dotNetControl uiTabs "TabControl" pos:[0,0]
fn SetLifeTimeControl ctrl = dotNet.setLifeTimeControl ctrl #dotNet
fn ResizeUI =
(
w = nameTagToolRO.width
h = nameTagToolRO.height
uiTabs.width = w
uiTabs.height = h
)
fn InitTextbox pos:[0,0] width:0 =
(
c = dotNetObject "Textbox"
c.Location = (dotNetObject "System.Drawing.Point" pos[1] pos[2])
c.Tag = "resize"
c.AcceptsTab = True
c
)
fn InitTabs ctrl:unsupplied =
(
if ctrl != unsupplied do
(
ctrl.TabPages.Clear()
ctrl.sizeMode = ctrl.sizeMode.fixed
ctrl.itemSize = dotnetObject "System.Drawing.Size" 75 25
ctrl.TabPages.add "Nodes"
ctrl.TabPages.add "Materials"
ctrl.Appearance = tabStyle.buttons
ResizeUI()
uiName = InitTextbox pos:[70,37] width:0
ctrl.TabPages.Item[0].controls.add uiName
)
)
on nameTagToolRO open do
(
InitTabs ctrl:uiTabs
)
)
createDialog nameTagToolRO width:400 height:600 style:#(#style_SysMenu, #style_titlebar, #style_minimizebox, #style_resizing)
1 Reply
Apr 16, 2015 11:40 pm
register for the textbox’s gotFocus event and disable 3dsmax accelerators using
enableAccelerators = false