mousewheel

Disable browser scrolling with the middle mouse scroll button

我的梦境 提交于 2019-12-01 22:35:44
I have a flash element on my page that you interact with by using the middle mouse scroll wheel. The page is long. So when scrolling with the mouse wheel it interacts with the Flash element AND scrolls the browser window. Is there a way to disable browser scrolling while the Flash element is active? You can use: document.body.style.overflow=allowScroll?"":"hidden"; Where allowScroll is a boolean. daslicht <!-- disables browser mouse scrolling --> <script type="text/javascript"> if(window.addEventListener){ window.addEventListener('DOMMouseScroll',wheel,false); } function wheel(event) { event

How to zoom at a point in picturebox

帅比萌擦擦* 提交于 2019-12-01 19:01:26
This is my code. I am able to zoom the picturebox but not at a point. How to zoom to a mouse point when i rotate the mouse wheel? The variables are:- private double m_dZoomscale = 1.0; //THIS IS THE ZOOM SCALE TO WHICH EACH OBJECT //ARE ZOOMED IN THE CANVAS public static double s_dScrollValue = .01; //scale factor value for mouse scroll zooming The paint code is:- private void m_Picturebox_Canvas_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.ScaleTransform((float)m_dZoomscale, (float)m_dZoomscale); } The main code is:- protected override void OnMouseWheel(MouseEventArgs

jQuery UI Slider -> with mousewheel support?

时光怂恿深爱的人放手 提交于 2019-12-01 17:21:47
问题 as you may already know I'm new to jQuery, so Code-Improvements not belonging to this theme are still very allowed. This is my HTML-Code: <div style="display: inline-block; width: 120px;"> <div> Bananas: <br /> <input id="bananas_amount" /> <input id="bananas_amount_percent" /> </div> <br /> <div id="bananas" style="height:200px;"></div> </div> And this is my horrifying js-code: $( "#bananas" ).slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 20, step: 5, slide:

How can I scroll my panel using my mousewheel?

≯℡__Kan透↙ 提交于 2019-12-01 15:35:01
I have a panel on my form with AutoScroll set to true so a scrollbar appears automatically. How can I make it so a user can use his mouse wheel to scroll the panel? Thanks SO. The panel or a control in the panel must have focus. Note that if the control with focus has scroll bars, it will scroll instead of the panel. What worked for me was adding panel1_MouseEnter EventHandler: private void panel1_MouseEnter(object sender, EventArgs e) { panel1.Focus(); } Below code works for me..... Public Form { InitializeComponent(); this.MouseWheel += new MouseEventHandler(Panel1_MouseWheel); } private

Enable mouse wheel scrolling in combobox/listbox

浪尽此生 提交于 2019-12-01 08:08:06
问题 I am building a userform in Excel 2007 using VBA and would like to know how to enable mouse wheel scrolling of comboboxes and listboxes. Do I need a more recent version of Office to get this feature or is it something that can be coded for? 回答1: if using 32-bit Windows then the solutions by PETER THORNTON using WIN32 API calls on the below page will help: MSDN Forums - Visual Basic For Applications: Mouse scroll in UserForm ListBox in Excel 2010 The OP on that page was using Excel 2010 but as

How to zoom-in and zoom-out a image in picturebox using mouse wheels in c#?

為{幸葍}努か 提交于 2019-12-01 07:31:46
I want to zoom-in or zoom-out a image on picturebox using mouse wheels in c#.How Can i do? Sivodaya Tech This topic helps to zoom in and out picture in picturebox add below code inside the picturebox mouse wheel event if (e.Delta != 0) { if (e.Delta <= 0) { //set minimum size to zoom if (PictureBox1.Width < 50) return; } else { //set maximum size to zoom if (PictureBox1.Width > 500) return; } PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * e.Delta / 1000); PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * e.Delta / 1000); } Use the MouseWheel event : http://msdn.microsoft.com

Change the scrollbar speed upon mouse scroll

痞子三分冷 提交于 2019-12-01 06:34:39
问题 Is it possible to change the scrollsbars speed upon scrolling using the mouse wheel for a element in JavaScript? 回答1: You could do something like this: http://jsfiddle.net/V3aaN/2/ ( Edit: May cause seizures or epilepsy ) CSS: #smallBox { height:400px; overflow-y:scroll; } #whee { height:20000px; } HTML: <div id="smallbox"> <div id="whee"></div> </div> JS: var thing = $('#smallBox'); var extra = 100; var old = $(thing).scrollTop(); $(thing).scroll(function() { if ($(thing).scrollTop() < old)

How to zoom-in and zoom-out a image in picturebox using mouse wheels in c#?

白昼怎懂夜的黑 提交于 2019-12-01 04:20:45
问题 I want to zoom-in or zoom-out a image on picturebox using mouse wheels in c#.How Can i do? 回答1: This topic helps to zoom in and out picture in picturebox add below code inside the picturebox mouse wheel event if (e.Delta != 0) { if (e.Delta <= 0) { //set minimum size to zoom if (PictureBox1.Width < 50) return; } else { //set maximum size to zoom if (PictureBox1.Width > 500) return; } PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * e.Delta / 1000); PictureBox1.Height += Convert

Can the mouse wheel be used while dragging/dropping?

喜欢而已 提交于 2019-12-01 03:28:52
In WinForms, after calling a DoDragDrop to start dragging an item, controls no longer scroll with the mouse-wheel, and the control's MouseWheel event is no longer called, until the user drops whatever he is dragging. Is there a way to get the mouse wheel to work while dragging? riel You could get a global MouseWheel with a keyboard hook. using System; using System.ComponentModel; using System.Runtime.InteropServices; using System.Windows.Forms; using Microsoft.Win32.SafeHandles; using BOOL = System.Boolean; using DWORD = System.UInt32; using HHOOK = SafeHookHandle; using HINSTANCE = System

Always scroll a div element and not page itself

核能气质少年 提交于 2019-12-01 03:21:19
I have a page layout with an inner <div id="content"> element which contains the important stuff on the page. The important part about the design is: #content { height: 300px; width: 500px; overflow: scroll; } Now when the containing text is larger than 300px, I need to be able to scroll it. Is it possible to scroll the <div> , even when the mouse is not hovering the element (arrow keys should also work)? Note that I don’t want to disable the ‘global’ scrolling: There should be two scrollbars on the page, the global scrollbar and the scrollbar for the <div> . The only thing that changes is