Thank you, it works like a charm but there’s an issue about it: you cannot click on the button.
See this code:
fn TransparentLabelfn =
(
source = “using System.Windows.Forms;
class TransparentLabel : Label
{
static void Main()
{
}
protected override CreateParams CreateParams
{
get
{
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
const int WS_EX_TRANSPARENT = 0x20;
CreateParams result = base.CreateParams;
result.ExStyle = result.ExStyle | WS_EX_TRANSPARENT;
return result;
}
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
}
}”
csharpProvider = dotnetobject “Microsoft.CSharp.CSharpCodeProvider”
compilerParams = dotnetobject “System.CodeDom.Compiler.CompilerParameters”
CompilerParams.ReferencedAssemblies.Add(“System.dll”)
compilerParams.ReferencedAssemblies.Add(“System.Windows.Forms.dll”)
CompilerParams.GenerateExecutable = true
CompilerParams.GenerateInMemory = true
compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source)
compilerResults.CompiledAssembly
)
TransparentLabelfn()
rollout test “test”
(
local colors = DotNetClass "System.Drawing.Color"
local img = (dotNetClass “System.Drawing.Image”)
dotnetcontrol test “label” width:100 height:100 pos:[0,0]
dotnetcontrol button_Config “TransparentLabel” pos:[0,0] width:100 height:100
local pathImg_Config = img.fromFile(“C:/Users/Jen/Desktop/b/d.png”)
on test open do
(
button_Config.image = pathImg_Config
test.backColor = colors.fromArgb 0 255 255
)
on button_Config click do
messagebox(“yes”)
)
createdialog test
if the color and the button are at the same position the click event doesn’t work. It’s like the color is on top of the button. If I offset the position of the button of the right for example: the part “outisde of the color boundaries” is clickable.