ユーザ インタフェース コントロール上のフォーカスの設定

特定のユーザ インタフェース コントロール項目(RolloutFloater または Rollout)にフォーカスを設定するには、以下を使用します。

setFocus (<RolloutControl>|<RolloutFloater>|<Rollout>|<Rollout>.hwnd)

前面に移動し(「一番上」のダイアログにするなど)、ユーザ インタフェース コントロール項目の RolloutFloater または Rollout にフォーカスを設定するには、以下を使用します。3ds Max 2021.1 Update以降で使用できます。

setForegroundWindow (<RolloutControl>|<RolloutFloater>|<Rollout>|<Rollout>.hwnd)

例:

   rollout testFocus "Test Focus"
   (
     edittext text1 "Test"
     edittext text2 "Focus"
   )
   createDialog testFocus 200 100
   testFloater = newRolloutFloater "My Floater" 300 220

   setfocus testFocus
   setfocus testFocus.hwnd
   setfocus testFocus.text2 -- the second text field gets focus
   setfocus testFloater

   setForegroundWindow testFocus
   setForegroundWindow testFocus.hwnd
   setForegroundWindow testFloater

3ds Max 6 以降の場合

SetFocus() を使用して ActiveX コントロールのフォーカスも設定できます。