ScriptSpot

Forum topic · General Scripting

dotnet focus

By JokerMartini · 2015-04-16

Description

How come when i click in the text field and begin typing nothing appears. It seems to be that dotnet bugs out when a control is inside another control which is what i have. I have a dotnet label inside a dotnet tab/.....?


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)