dotnet button visible

Hi everyone

I'm trying to toggle the visibility of a dotnet button inside a maxscript dialog, but I don't find how to get it work so far...

her's my code for now:

try (destroyDialog TestRoll) catch()
 
Rollout TestRoll "TestRoll"
(
 
dotNetControl Btn1 "system.windows.forms.button" width:50 height:50 pos:[5,5]
button Btn2 "toggle visible"
 
on testRoll open do
(
	local logoImg = dotnetObject "System.Drawing.Bitmap" @"C:\bitmap.jpg"
	Btn1.image = logoImg
	Btn1.Visible = false
)	
 
on Btn2 pressed do mmBtn1.Visible = true 
 
 
)
createDialog TestRoll style:#(#style_toolwindow, #style_sysmenu)

So for me the dotnet button should not be visible while the dialog open and should appears when I clic on btn2.
However when the dialog open, Btn1 is white and when I click on Btn2, the Btn1 shows the pictures, while I need the button to be hide or visible (with the picture)

Thanks in advance for any help

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SugaR's picture

Thanks for your reply

Thanks for your reply Barigazy.

I didn't understand it at first but a bit of research after... Yes it works like a charm !

A big thanks :)

barigazy's picture

...

Use .net panel as dotnet control and add .net button inside.
.net button must be dotnet object

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.