If I have a winform, may I know how can I control the zoom level of the font in the application (as well as the application window itself obviously) by using Ctrl + Mouse Scroll Wheel? I see there is a Delta in the Scroll Wheel event, but not sure how that works. Is there any code sample that I can look into?
Control zoom level of WinForms using mouse scroll wheel and Ctrl in VB.NET
10.7k views Asked by AZhu At
3
There are 3 answers
Related Questions in VB.NET
- If...Then...Else Visual Basic 2012
- Detecting whether a mouse button is down in vb.net
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- vb.net Get PrivateMemorySize64 and process id sort by memory size
- Cannot insert values into database
- check validation of an expression with Regex
- VB.NET KeyNotFoundException from String()
- How do i display data that are in between 2 values in a DDL?
- VB.net: How to make original variable value fulfill 2 statements?
- Login form by using a new database, made in VB
- Get Text from listbox in VB.net
- error handing for uploading large size file
- XML Null Element Visual Basic
- Using chart and tooltip
- vb2010 Express - Operator '=' is not defined
Related Questions in WINFORMS
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- How to Require Confirmation on Form Close When there is Changed Data in a DataGridView
- self updating drawings C#
- Missingmanifestresourseexeption in auto genereted code of ImageList
- Child form implement in C# Winform
- Cannot find InvalidCastException in C# Application
- some labels appear gray in Visual Studio 2010
- c# richtextbox search with 2 forms
- Menu out of place when application is in full screen by Windows API
- How to access the Index of a changed Selection in a Datagridview
- showing a black transparent box over picturebox with an Image
- how to deselect all in RichTextBox before selecting newly found text?
- How to remove white space between border and BackColor?
- Validation DataGridView Windows Forms
- Invoke of a UserControl doesn't work
Related Questions in SCROLL
- Scrollable Edittext in Listview in android
- Slow drawing of items in ListView with many columns
- GWT Datagrid slow scroll due to css rendering
- Scrolling pictures increase (android)
- backgrounds Slideshow, but text scrolling
- Android - RecyclerView - How do I temporarily prevent scrolling?
- Onscroll not applying class
- Fix on scroll but with varying screen size no set pixel distance
- Change logo when scrolled to a certain div
- Targetting the background of a div for a jquery parrallax scroller
- Jquery panel + scroll from top detection?
- Button fixed to page when scrolling in mobile view with Javascript
- Homepage scrolling issues
- Super Mario side-scrolling C#
- How to detect which element is on the center of the screen with scroll position?
Related Questions in ZOOMING
- Make scaled-down image on HTML page clickable to see it in full size
- D3 Bounded Panning
- fabricjs - Zoom canvas in viewport (possible?)
- Google Maps v3 fitBounds inconsistent zoom
- Crop image with settable center and scale in Python PIL
- How to zoom into a picturebox image without changing the image sharpness?
- How can I implement a Zoom Panel with Java Swing libraries
- Divs move around when i zoom in/out
- How to check if user have zoom from js?
- Protractor key-down and send keys to zoom browser
- zoom jpeg image on canvas with mousewheel event in javascript
- UICollectionVIew zoom of a single UIImageView in a cell
- Zooming the ggplot or normal plot in R
- Graphic, zoom function
- how to maintain the location of a picturebox in the panel
Related Questions in CTRL
- Detecting ctrl+z (and other control combos) in paper.js
- Will Python execute finally block after receiving Ctrl+C
- Handle Ctrl+Z (undo/redo) for text editor in single page application
- CTRL + a select all in entry widget tkinter python
- javascript check key is clicked
- content assist is not available at current location error if I use ctrl+space for the views declared inside <android.support.v4.widget.DrawerLayout>
- Angular Ctrl click?
- Pressing ctrl and shift not work stands .ahk
- ctrl + enter seems not working with UIKeyCommand
- All Bookmarks are redirecting to same element
- How to detect user input of CTRL-X in C++
- Sending ctrl+C over serial port in C#?
- Control zoom level of WinForms using mouse scroll wheel and Ctrl in VB.NET
- getch() to capture Ctrl-*letter* on linux
- AHK How to switch Ctrl and Shift keys
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You'll have to handle the
KeyDownandKeyUpevent in order to determine whether or not Ctrl key is being held down. This value should be stored at class-level because it will be used by other subroutines besides theKeyDownandKeyUpevents.You then write code to handle the form's
MouseWheelevent. Scrolling downwards (towards you) causes a negative value for theDeltaproperty of theMouseEventArgs. Scrolling upwards is obviously the reverse. The value of the Delta property is always currently 120.Microsoft's reason for this value is as follows:
In your context you'll just check for the sign of the Delta and perform an action.
Here is a sample code implementing basic 'zoom' functionality:
Read on the following for more information about your question: