fromRhinoimport*fromRhino.Commandsimport*fromRhino.UIimport*fromSystem.Windows.Formsimport*
m_dlg =NonedefRunCommand():Dialogs.SetCustomColorDialog(OnSetCustomColorDialog)returnResult.SuccessdefOnSetCustomColorDialog(sender, e):
m_dlg =ColorDialog()if m_dlg.ShowDialog(None)==DialogResult.OK:
c = m_dlg.Color
e.SelectedColor= c
if __name__ =="__main__":RunCommand()
ImportsRhinoImportsRhino.CommandsImportsRhino.UIImportsSystem.Windows.FormsNamespace examples_vb
PublicClassReplaceColorDialogCommandInheritsCommandPublicOverridesReadOnlyPropertyEnglishName()AsStringGetReturn"vbReplaceColorDialog"EndGetEndPropertyPrivate m_dlg AsColorDialog=NothingProtectedOverridesFunctionRunCommand(doc AsRhinoDoc, mode AsRunMode)AsResultDialogs.SetCustomColorDialog(AddressOfOnSetCustomColorDialog)ReturnResult.SuccessEndFunctionPrivateSubOnSetCustomColorDialog(sender AsObject, e AsGetColorEventArgs)
m_dlg =NewColorDialog()If m_dlg.ShowDialog(Nothing)=DialogResult.OKThenDim c = m_dlg.Color
e.SelectedColor= c
EndIfEndSubEndClassEndNamespace