Код:
Код: Выделить всё
const int GWL_EXSTYLE = -20;
const uint WS_EX_LAYERED = 0x80000;
const uint LWA_ALPHA = 0x2;
void Form_Load(object? sender, EventArgs e)
{
// Form
SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_LAYERED);
SetLayeredWindowAttributes(Handle, 0x000000, 0, LWA_ALPHA);
// PictureBox
SetWindowLong(picBox1.Handle, GWL_EXSTYLE, WS_EX_LAYERED);
SetLayeredWindowAttributes(picBox1.Handle, 0x000000, 128, LWA_ALPHA);
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... ributes-in