This is a preview version of Cyotek's blog and may be missing functionality and/or unstable. Please visit https://www.cyotek.com/blog for the current version of the blog.
If you encounter any problems using this preview site, please contact us with the details.

Posts tagged with 'scroll'

Creating a scrollable and zoomable image viewer in C# Part 4

c# winforms scroll zoom image graphics pan imagebox 32 Comments Downloads

In the conclusion to our series on building a scrollable and zoomable image viewer, we'll add support for zooming, auto centering, size to fit and some display optimizations and enhancements.

Unlike parts 2 and 3, we're actually adding quite a lot of new functionality, some of it more complicated than others.

Read More

Creating a scrollable and zoomable image viewer in C# Part 3

c# winforms scroll zoom check image imagebox 2 Comments Downloads

After part 2 added scrolling support, we are now going to extend this to support keyboard scrolling and panning with the mouse.

In order to enable panning, we're going to add three new properties. The AutoPan property will control if the user can click and drag the image with the mouse in order to scroll. Also, we'll add an InvertMouse property to control how the scrolling works. Finally the IsPanning property; however it can only be read publically, not set.

Read More

Creating a scrollable and zoomable image viewer in C# Part 2

c# winforms scroll zoom check image imagebox 1 Comments Downloads

In the second part of our Creating a scrollable and zoomable image viewer in C# series we will update our component to support automatic scrolling when auto size is disabled and the image is larger than the client area of the control.

Originally we inherited from Control, however this does not support automatic scrolling. Rather than reinventing the wheel at this point, we'll change the control to inherit from ScrollableControl instead. This will expose a number of new members, the ones we need are:

Read More

Creating a scrollable and zoomable image viewer in C# Part 1

c# winforms scroll zoom check image imagebox 2 Comments Downloads

This is the first part in a series of articles that will result in a component for viewing an image. The final component will support zooming and scrolling.

In this first part, we're going to create a basic image viewer, without the scrolling and zooming. Rather than having a plain background however, we're going to create a two tone checker box effect which is often used for showing transparent images. We'll also allow this to be disabled and a solid colour used instead.

Read More

Adding a horizontal scrollbar to a ComboBox using C#

c# winforms combobox horizontal scroll api 4 Comments Downloads

In our WebCopy application we decided to update the User Agent configuration to allow selection from a predefined list of common agents, but still allow the user to enter their own custom agent if required.

Rather than use two separate fields, we choose to use a ComboBox in simple mode, which is both a textbox and a listbox in a single control. This mode seems somewhat out of fashion, I think the only place I see it used is in the Font common dialog, virtually unchanged since Windows 3.1.

Read More