.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Making a scrollable panel scroll with mousewheel just by hovering mouse

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :Windows Application
Hi, I have a particular problem with a possible solution and I am interested in hearing peoples opinions if it is the right way to go about it (or not  ) Some applications I have come across, such as Firefox, will allow the user to scroll the document window just by hovering the mouse over the display area and using the mouse wheel. You don't have to focus / select the display area first. With Firefox, the address bar can have the focus and the keyboard input but you can still scroll the document. Contrasting with IE and Visual Studio, you have to click into the document area before it responds to mouse wheel messages. In my winforms app, I have a tab control with several scrollable tabpages as well as scrollable panels in other places. Some of these just display data and don't have controls that can be focused or tabbed into. I would like to emulate the firefox behaviour described above. What I have done is created a class, ScrollPanelMessageFilter, that implementes System.Windows.Forms.IMessageFilter and that takes a Panel as it constructor parameter. It detects the mouse wheel when the cursor is over the display area and sends the message to the panel: using System;using System.Collections.Generic;using System.Diagnostics;using System.Drawing;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;namespace MouseWheelTest{   

View Complete Post

More Related Resource Links

Why is the scrolling with a scroll wheel on a mouse so choppy in VS.NET 2010?

I have a Microsoft Mouse that contains a scroll wheel used for scrolling the vertical scroll bars in applications. IE, Word, Outlook, Safari, you name it have smooth consistent scrolling when using the wheel.  However in VS.NET 2010 it is real choppy, like the scroll bar moves in steps or increments. Is there a configuration specific to VS.NET 2010 for configuring this?

Get scroll value after mouse wheel on datagrid



How can I get scroll value after mouse wheel on datagrid?
I need this for synchronize 2 datagrid scrolling action.


The .NET programmer

How to stop Horizontal Scroll bar on Panel?


I have a panel on a pretty basic C# page.  I've set the height, and width, and set thescrollbars = "Vertical".  However, on some pages, the panel adds a horizonal scroll bar.  It seems very random, and I can't figure out why or how to prevent the panel from adding horizontal scroll bars.   The content in the panel is dynamic from a sql database, and I use a Repeater to display the returned sql. 

 Here is my code from my page for the panel.  Did I forget something????


datagriview scroll - using mouse wheel


I know the option to scroll down the dgv using the mouse-wheel is associated with the scroll bars.

i had to disable the scroll bars but would still like to enable the use of the mouse wheel to scroll down the grid.

i have no idea how, nor i have seen an event for the mouse wheel.

any help would be appreciated


Maintain Scroll position on postback in a asp:panel?


Hi, I'm having a lot of trouble figuring this out. I'm unable to hold the scroll position in the postback in a panel that I set up with a gridview. I tried some of the links offered in the previous threads and it still doesn't seem to be working. Here's the code I have so far, maybe I am missing something small.

<asp:Panel runat="server" ScrollBars="Vertical" 
                 scrollPOS="<%=saveScrollPos.value %>"
                 style="BEHAVIOR: url(<%=ResolveURL('../Includes/ScrollPos.htc')%>); WIDTH: 4000px; HEIGHT: 1000px" >
                 <input id="saveScrollPos" type="hidden" runat="server" name="saveScrollPos"/>
                   <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="View1" runat="server">


Here is the behavior file It points to:

<PUBLIC:ATTACH EVENT=ondocumentready ONEVENT="elementLoad()" />

// DHTML behavior for scrollable

Mouse scroll up and down event is not triggered on picturebox.


I have a picture box in my form and now I want to add an event so that if the mouse is scrolled up the scale of the picture box gets larger and when the user

scrolls down the size off the picture box gets smaller. This way I want to make a zoom in and out effect.

So now i have the following code in the mouse wheel event of the Picture box:






End If


But somehow this whole mouse wheel event isn't fired. Does anybody know what might be the problem here?


Scroll/Zoom Windows.Forms.Panel controls


Is there some "thumbnail" or other "easy" way to provide the ability to have a populated panel of UserControl derived objects and scrollbar "move" them and "middle mouse zoom" them on the Client area of the panel?

I am using net FrameWork 4.0  The documentation leaves a tantilizing trail and I sure it can be done, but I do not want to miss something so simple like using the Thumbnail/bitmap/Background properties or methods of the Panel control? 

Thanks Everyone



Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

How to highlight datagrid or GridView row on mouse over?

This article will show how you can Ajax with GridView to display popup messages when mouse moves over certain column. In the demo project I have added first column as an image column with a help icon in it. This kind of implements a feature that if you want more information about the row you can move mouse over this icon, a asynchronous request is sent to server for data about that row and when call returns the returned message is show as a popup message.

Making Sense of ASP.NET Paths

ASP.Net includes quite a plethora of properties to retrieve path information about the current request, control and application. There's a ton of information available about paths on the Request object, some of it appearing to overlap and some of it buried several levels down, and it can be confusing to find just the right path that you are looking for.

Scrollable GridView with fixed headers in asp.net C# vb.net

In this example i am going to show how to create scrollable GridView with fixed headers which don''t get scrolled with records and stay on the top in asp.net using css, I''ve tested this code on IE7 and Firefox 2.0 , 3.5.

For this we need to add css to headers of gridview to keep them on the top.

First of all place a Panel on the aspx page from thetoolbox. Set height to 200px and width to 200px
and scrollbars to Vertical.
Now add a gridview inside this Panel and set the datasource to populate gridview.

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



Netting C++: EEK!-Time to Design the Mouse


This month begins the design of the actual mouse class for EEK!

Stanley B. Lippman

MSDN Magazine December 2007

Advanced Basics: A Match-Making Game in Visual Basic


My four-year-old son has decided that he wants to be like his dad when he grows up. He is planning to work in my office, and write computer programs just like I do. But there is one problem-he thinks I write games.

Duncan Mackenzie

MSDN Magazine October 2005

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend