How do i dock a window to the bottom of the screen?
-
Hey all, I got a window that is 25px in height, and want it to dock to the screen bottom (so the height is 25px, and the width is 100%), it's because I'm making a RSS newsticker, and want it to slide at the bottom of the screen. Thanks. :) Best Regards, Elias Sørensen
-
Hey all, I got a window that is 25px in height, and want it to dock to the screen bottom (so the height is 25px, and the width is 100%), it's because I'm making a RSS newsticker, and want it to slide at the bottom of the screen. Thanks. :) Best Regards, Elias Sørensen
is this a windows form ??
When you get mad...THINK twice that the only advice Tamimi - Code
-
is this a windows form ??
When you get mad...THINK twice that the only advice Tamimi - Code
-
try this on form load: this.Location = New Point(0, Screen.PrimaryScreen.Bounds.Height - thid.Height); this.Width = Screen.PrimaryScreen.Bounds.Width;
When you get mad...THINK twice that the only advice Tamimi - Code
-
try this on form load: this.Location = New Point(0, Screen.PrimaryScreen.Bounds.Height - thid.Height); this.Width = Screen.PrimaryScreen.Bounds.Width;
When you get mad...THINK twice that the only advice Tamimi - Code
I've tried this: private void Form1_Load(object sender, EventArgs e) { this.Location = New Point(0, Screen.PrimaryScreen.Bounds.Height - thid.Height); this.Width = Screen.PrimaryScreen.Bounds.Width; } But I get an error ; expected. Sorry if I've done it wrong, only made c# in 2 days ;)
-
I've tried this: private void Form1_Load(object sender, EventArgs e) { this.Location = New Point(0, Screen.PrimaryScreen.Bounds.Height - thid.Height); this.Width = Screen.PrimaryScreen.Bounds.Width; } But I get an error ; expected. Sorry if I've done it wrong, only made c# in 2 days ;)
-
Hello, I think you only made "fat finger" errors! ;) New -> new thid.Height -> this.Height
this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - this.Height); this.Width = Screen.PrimaryScreen.Bounds.Width;
All the best, Martin
-
Thanks! It is working! BUT! I could't find the window.. Because it was placed behind the process bar (it was only because I got aero, that i could see it). Do you know how to fix that?
The problem is in the "Y" axis location. Remember Y = "down the screen". this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - this.Height); sets a location specified as x,y points. try: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height / 2) ); You should see your line in the middle of the screen. Adjust the second parameter to be where you want it.
-
The problem is in the "Y" axis location. Remember Y = "down the screen". this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - this.Height); sets a location specified as x,y points. try: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height / 2) ); You should see your line in the middle of the screen. Adjust the second parameter to be where you want it.
It didn't work perfect, but i tried to use: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height + 30)); And that works perfect. But! If i make the processbar bigger, it follows, but if i make it smaller, it is the same place as before, do you understand?
-
It didn't work perfect, but i tried to use: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height + 30)); And that works perfect. But! If i make the processbar bigger, it follows, but if i make it smaller, it is the same place as before, do you understand?
Try this: this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
-
Try this: this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
-
Doesn't work when i'm doing this: this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height); this.Width = Screen.PrimaryScreen.Bounds.Width; this.Height = 22; Have i made a mistake?
Since the code I gave you uses the Height of the object, you need to set the height before executing that line. -- this.Height = 22; //this done first this.Width = Screen.PrimaryScreen.Bounds.Width; //moved here to keep height and width in the same code locations this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
-
Since the code I gave you uses the Height of the object, you need to set the height before executing that line. -- this.Height = 22; //this done first this.Width = Screen.PrimaryScreen.Bounds.Width; //moved here to keep height and width in the same code locations this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
-
Try this: this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
-
It didn't work perfect, but i tried to use: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height + 30)); And that works perfect. But! If i make the processbar bigger, it follows, but if i make it smaller, it is the same place as before, do you understand?
I couldn't respond to your email because you haven't confirmed your address. I'm glad to see you got your answer.