How to hide ScrollBar arrows in C# / .NET - c#

I would like to use a ScrollBar in my app but I don't want the default end-arrows showing up; I want to be able to use other "external" controls for activating the scroll bar. Any ideas?

Please don't - scrollbar arrows are an essential accessibility feature when a document is too long to scroll by dragging the scrollbar and when a user lacks a mousewheel or the means to use it, then the only way to scroll is by clicking on the arrow buttons.
(Apple gets away with it because all of their modern hardware supports touch-scrolling, but us on the Windows camp don't have that luxury)

Related

How to hide the mouse cursor for all windows in C#?

TLDR: How to programmatically hide the mouse cursor for entire desktop no matter the application that has focus?
Even though I have "Hide pointer while typing" enabled in Windows Mouse Options, it doesn't work for most windows. It only seems to work on windows that use the standard Windows text box control (such as notepad.exe). Everywhere else, the cursor stays right on top of whatever I'm typing.
I want to programmatically hide the mouse cursor across the entire desktop no matter what application has focus, when I execute a specific action (for example, a hotkey is pressed). Then, when the mouse is moved, I want the cursor to reappear.
I can handle the hotkey etc. I just need to know how to hide the cursor.
What I have tried:
Cursor.Hide method only hides cursor for the current form. This is not an acceptable solution.
Windows API ShowCursor function - just doesn't seem to work at all... the cursor never disappears.
Currently my workaround is to listen for the Spacebar to be pressed (implies I'm typing more than a few characters), then move the mouse cursor to the top corner of the desktop, out of the way. However, this is not an ideal solution as it requires the mouse to be moved a lot to return to the original position, as well as messing up mouse position in apps such as Sketchup when entering dimensions containing spaces. I would prefer that the cursor simply become invisible in its current location, then reappear at the same location when moving the mouse, as it is supposed to work with the "Hide pointer when typing" option.
I'm not tied to C# but it's just easy to compile into an executable for Windows, which I can launch on Windows startup.
Thank you for any help!

How to make a winforms scrollbar wider using c#

This program uses winforms and c# (no wpf). I have a panel with buttons on it and getting it to scroll is no problem. However, when the program is on a hi-resolution touch screen -- like a Surface 7 -- trying to touch in the exact right spot to get it to scroll is hit and miss. I've searched and have yet to find a way to make the grab area (so to speak) of a vertical scroll bar wider so that when you touch the screen, the control actually picks up the event. Any ideas on how to do this?
If your application is DPI unaware, then it is enough to set the scrollbar width to SystemInformation.VerticalScrollBarWidth.

Winforms ToolTip is displayed too far from hovered control

I have a WinForms application. All ToolTips are appearing too far below the hovered controls. It happens on tool bars and menus.
I think the reason is that form's font is changed. It is MS Segoe UI 9px.
Is there a solution to move ToolTip to its default place in general for the whole app?
The screen shot is on Windows 8 "Segoe 9px" font. 100% font scaling. The issue appears on other DPI settings and on other windows versions also.
Edit
I compared ToolTip position of my app and VS2012 and Chrome. In my app, ToolTip appears one cursor height below the bottom of the cursor. In VS2012 and Chrome, ToolTip appears one cursor height below the hot point of the cursor (about 2 pixels below the cursor).
Cursor not visible in screen shots:
Edit 2
I checked other winforms apps with default font settings. The ToolTip also appears one cursor height below the bottom of the cursor. It seams this is the default position for winforms. However it doesn't look well compared with other software.
It looks like it can be fixed only with overriding the default ToolTip behavior.
Default tooltip in winforms toolstrip have several problems. I've built custom toolstrip that has custom tooltip available at http://www.codeproject.com/Articles/376643/ToolStrip-with-Custom-ToolTip. I am not 100% sure whether it will solve your problem out of box, but you can fully customize how tooltip appears by altering code.

Making a graphical element "dock-like"

Specifically, what I am try to is overlap my element on top of everything, including the desktop, similar to the taskbar in Windows. I have a Windows Form Control that looks kind of like a tab. its like 50px wide by like 150px in length. What I would like to do is have that control appear in front of all windows, including the desktop itself. I say "dock-like" because I belive docking pushes windows over (so if my tab was docked, it would push any full screen application window over 50px), which is not what I'm trying to do. I want my tab to overlay on top of everything. The closest example I can think of is Winamp. Winamp can dock to the top of the screen and it is always on top of any application.
how can do this in C#?
System.Windows.Forms.Form has a property, TopMost, which will cause the form to stay on top of other windows.
The "snapping" behavior of Winamp can be implemented by using the Move event of the form--when the form is moved close enough to the edge of the screen, programatically set the position so that it's on the edge.

Scrolling horizontally and vertically ListView WinForms C#

I've couple of questions regarding scrolling ListView without using external ListView controls from other vendors (free or pay versions).
How to make 2 (or more) ListView bound together in the way that if i start scrolling one ListView the other one does exactly the same? Is it even possible to do with native 3.5 or 4.0 (when it's released) ListView?
When you try to scroll ListView right or left using the arrows on the scroll bar it's very very slow. For fast way you either have to grab the scroll and move it yourself or do jumps with it. Is there a way to make the left or right moving faster? A bit like down/up? (although i guess the speed is the same just the length to scroll is proportionally longer).
With regards,
MadBoy
You will have to use P/Invoke to make this work. You'll find example code in this thread. It is for a ListBox, it will also work for ListView. Use pinvoke.net to find the C# declaration for SendMessage.
I'm not aware of a fix for the scroll increment. The SetScrollInfo API function doesn't allow setting the small step increment.

Categories