Color + png file on button?


#21

Alright thanks!

By using this method the event MouseEnter doesn’t work anymore?

on button_config MouseEnter do
test.backColor = colors.fromArgb 0 0 0

changing the color while the mouse is over it

same if i change the png

local pathImg_Config3 = img.fromFile(“C:/Users/Jen/Desktop/b/f.png”)
on button_config2 MouseEnter do
button_Config2.image = pathImg_Config3


#22

this is static method
below is dynamic method

dotNet.addEventHandler <dotNetControl> <EventNameString> <function>

dotNet.addEventHandler button_config "MouseEnter" MouseEnterfunction


#23

dotNet.addEventHandler button_config “MouseEnter”(button_Config2.image = pathImg_Config3)

like that?


#24

it can , but use VS to rewrite is better , mxs is low efficiency to do this and may appear mistake
mxs’s standard Syntax is definite the function first , then add event

fn event1 =
()
fn event2=
()
dotNet.addEventHandler button_config "MouseEnter" event1
dotNet.addEventHandler button_config "MouseLeave" event2

#25

this is the original question…

Two issues are combined in the question - the desire to have a Button with background color, and the desire to have an alpha-transparent Label. What is the reason to have them both? If you want to have the button, let just focus on it - make a Button with color background and alpha-transparent image (icon).
MXS doesn’t provide this kind of control, so you have to use anything else. For example with System.Windows.Forms you can do it, and you don’t need an extra control (Label in your case).


#26

However, you must understand that non-built-in MXS control will still stand out. I would try to find a solution that does the same, but remains consistent for the rest of the interface. For example, we cannot change the back color of the MXS button, but we can draw a frame around the button of any color.


#27

If you decide to use .NET controls anyway, you should understand that in the new versions of 3DS MAX, where almost all tools are replaced with Qt, any other UI solution will look alien and, frankly, ‘funny’.


#28

How do you create a global dotnetcontrol if you want to change the back color on a MouseEnter event?

fn event1 test2 =
(
test2.backColor = colors.fromArgb 255 255 255
)
dotNet.addEventHandler button_config “MouseEnter” (event1 test2)

throws me an error:
Unkown property: ARGB in undefined

@DenisT: I’m just trying new stuff here. Qt is already useable with 3ds max, right?


#29

the parameter is e if only 1 parameter , 1st parameter if have 2 parameters is s , 2cd is e
s means sender in vs , the control you need