skea Posted January 13, 2010 Posted January 13, 2010 Hi folks, I have an issue and i need some help. i would like to create a menu that scrolls "offScreen" and back like this Screen shot Utility by Arman. the source files are in VB.NET but i had to convert the what i think is the necessary code to C#. i have got something working but It's giving me hardtime to keep the form with bottom pixel at the screen top and unhiding it(hide and unhide it). I have attached something. Please take a look at it. Any help will be appreciated. thanks.MediaMapper.zip Quote
Leaders snarfblam Posted January 13, 2010 Leaders Posted January 13, 2010 This code seems to work as far as keeping the edge on-screen: private void MenuTimer_Tick(object sender, EventArgs e) { const int distanceOnScreen = 1; [color="Green"]// Possible problem. Try 4.[/color] int finalPosition = Screen.PrimaryScreen.Bounds.Top - this.Height + distanceOnScreen; if (this.InstantMenu) { if (this.Top > finalPosition) { this.Top -= 1; } else { this.MenuMotionOn(false, true); } } else { if (this.Top > finalPosition) { this.Top -= 1; } else { this.MenuMotionOn(false, true); } } } One problem here is that you are showing your form in the MouseEnter event. This event is raised when the mouse enters the client region, which does not include the borders or title bar. You either need to leave more of the form on the screen (see the comment in the code) or get rid of the border (or detect the mouse another way). Quote [sIGPIC]e[/sIGPIC]
skea Posted January 14, 2010 Author Posted January 14, 2010 Thanks. you are right. it was a border issue.i had to do away with the border. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.