Notifications
Clear all

[Closed] Change text color in rollout?

Is there any way to change the text color in a rollout? Or to make the font bold? Maybe somehow with using .Net? But I don’t want a separate frame/window around the text that .Net usually creates…

Thanks,
Lena

3 Replies

You could render your own text to a bitmap and use an imgtag to place it… but that’s craziness

If max’s windows messaging was a bit mor powerful, you would be able to adjust the font (in windows control terminology, a font is the font face, bold/italic/underline/etc. states, size, color in one) on the control directly…

But I think your best bet is still a .NET control. All you have to do is match the background color it uses by default to the background color 3ds Max uses:


rollout roll_test "test" (
	dotNetControl dnc_label "Windows.Forms.Label"

	on roll_test open do (
		dnc_label.text = "Hello World"
		local bkgCol = (colorman.getcolor #background * 255) as color
		dnc_label.backColor = (dotNetClass "System.Drawing.Color").fromArgb bkgCol.r bkgCol.g bkgCol.b
	)
)
createDialog roll_test

The rectangle behind the label still exists – but you can’t see it as it matches the surrounding background color.

If you just need another color (not another font/fontstyle) you could also use the hyperlink control. Set its .enabled property to false so it doesn’t repond to any mouse/keyboard events, and the .color property to adjust its fore color.

Martijn

Sweet! Both solutions work great. Thanks