hey i've a form given below.........with minimize,maximize,close button........
how can i remove all that and display the form with only the picture as shown below

Dani AI

Generated

As pointed out, remove the standard window chrome first; the suggestions below show how to turn that borderless window into a picture-only surface and make it behave like a normal window (moveable, not in the taskbar, shaped to the image).

Quick practical steps (set these in the form constructor or Load):

this.ControlBox = false;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Text = string.Empty;
this.ShowInTaskbar = false;
this.BackgroundImage = Image.FromFile("picture.png");
this.ClientSize = this.BackgroundImage.Size;

Make the non-image pixels transparent

  • For a simple approach: pick a solid "mask" color in the PNG and make it transparent at runtime using the form TransparencyKey. This is easy but can produce jagged edges.
  • For smooth alpha (true per-pixel transparency) use a layered window / alpha blend technique instead (more work but much better results on anti-aliased PNGs).

Enable dragging for a borderless window (mouse down on the image):

[DllImport("user32.dll")] static extern bool ReleaseCapture();
[DllImport("user32.dll")] static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
const int WM_NCLBUTTONDOWN = 0xA1;
const int HTCAPTION = 0x2;

private void Form_MouseDown(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        ReleaseCapture();
        SendMessage(this.Handle, WM_NCLBUTTONDOWN, new IntPtr(HTCAPTION), IntPtr.Zero);
    }
}

Advanced notes and cautions

  • If you need to hide the window from Alt+Tab, adjust extended window styles (WS_EX_TOOLWINDOW / WS_EX_APPWINDOW) in CreateParams.
  • TransparencyKey is quick but limited; for high-quality alpha use layered windows (see the Windows API UpdateLayeredWindow).
  • Test on multiple Windows versions and with DPI scaling—image sizing and hit-testing can behave differently.

Further reading: Form.TransparencyKey and UpdateLayeredWindow.

Recommended Answers

All 2 Replies

In form load write:

this.FormBorderStyle = FormBorderStyle.None;

thank u so much..................

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.