M
mwsenecal
I'm new to C#. Fortunately my background in other languages has made
the transition rather painless.
I'm trying to create a banner that resides at the top of the screen.
To do this I have created a class that inherits from Form. Obviously,
I don't want a frame, title bar, or taskbar button, so I eliminate
these, and set it so that it is drawn at the top of the screen.
BackColor = Color.White;
this.FormBorderStyle = FormBorderStyle.None;
this.Taksbar = false;
this.TopMost = true;
this.StartPosition = FormStartPosition.Manual;
this.Dock = System.Windows.FormsDockStyle.Top;
this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, 16);
this.Left = 0;
this.Top = 0;
By and large, things are working as expected. The problem I'm having
is that I can't get the minimum height of the banner to go below
what's about 20 pixels. That is, even if I explicitly set the height
to smaller (as above), it won't get any smaller. I'm starting to think
that the way I eliminated the border and title bar has something to do
with it. I've played with minimum size, maximum size, and a few other
things, but nothing has worked.
Is this possible, and how would I go about it?
Many thanks,
---Matt
the transition rather painless.
I'm trying to create a banner that resides at the top of the screen.
To do this I have created a class that inherits from Form. Obviously,
I don't want a frame, title bar, or taskbar button, so I eliminate
these, and set it so that it is drawn at the top of the screen.
BackColor = Color.White;
this.FormBorderStyle = FormBorderStyle.None;
this.Taksbar = false;
this.TopMost = true;
this.StartPosition = FormStartPosition.Manual;
this.Dock = System.Windows.FormsDockStyle.Top;
this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, 16);
this.Left = 0;
this.Top = 0;
By and large, things are working as expected. The problem I'm having
is that I can't get the minimum height of the banner to go below
what's about 20 pixels. That is, even if I explicitly set the height
to smaller (as above), it won't get any smaller. I'm starting to think
that the way I eliminated the border and title bar has something to do
with it. I've played with minimum size, maximum size, and a few other
things, but nothing has worked.
Is this possible, and how would I go about it?
Many thanks,
---Matt