trackbar

Is there any control or in way to use DateTime slider in windows form

久未见 提交于 2019-12-11 04:59:00
问题 I have a winForm, in which have a requirement to use Silder that could slide on DateTime and grid is refreshed according to the date selected. Is there any control that provides above functionality. Thanks in advance. 回答1: Yes, this control has name TrackBar. You can use it without labels: DateTime beginDate = // DateTime endDate = // datesTrackBar.Maximum = (int)(endDate - beginDate).TotalDays; And filter your grid on Scroll event: private void datesTrackBar_Scroll(object sender, EventArgs e

System.Windows.Forms.TrackBar memory use with a large maximum value

寵の児 提交于 2019-12-10 21:16:19
问题 I have a control that contains a System.Windows.Forms.TrackBar. I was setting its maximum value to ~200,000,000. When I did this, the control required 800MB of memory. Reducing the maximum value to 2,000,000 used a more reasonable amount of memory. //trackBar.Maximum = 210554060; // uses ~800MB of memory trackBar.Maximum = 1000000; // uses a small amount of memory Is this a bug in the Windows control? Or am I asking the trackbar to do something unreasonable? Update: I've created a new Windows

Control the computer's volume in C#

故事扮演 提交于 2019-12-10 18:56:50
问题 Is there a way to control the computer's actual volume in C# and display that in a vertical track bar?? I have tried practically everything, but there must be something I am missing. Thanks. 回答1: Have you tried using the winmm.dll library through p/Invoke? That's what this article recommends: http://www.dreamincode.net/forums/topic/45693-controlling-sound-volume-in-c%23/ He's (strangely) licensed his code with GPL, so I can't post it here. But it is pretty basic and simply calls various mixer

How to check for TrackBar sliding with mouse hold and release

微笑、不失礼 提交于 2019-12-10 18:47:24
问题 I have a trackbar in my WinForms program which by moving it a huge and time consuming method will be refreshed. Have a look at this code: trackBar_ValueChanged(object sender, EventArgs e) { this.RefreshData(); } This track bar has 20 steps. If user grab the trackbar's slider and pull it from 20 to 0 in my case, 'RefreshData' will be executed 20 times although it shows correct data when it ends the process that is 'RefreshData' with value 0, I want to do something like it only calls the

Trigger event on trackbar ValueChanged, but not in code

左心房为你撑大大i 提交于 2019-12-06 00:19:06
I want to be able to modify the value property of a trackbar in code without triggering my event handler. I wish to trigger the event only when the control is changed by the user by dragging the slider or moving it with the keyboard. What's the simplest way of achieving this? I have 6 trackbars and I want to change the value of 3 of them depending on which trackbar is changed. The issue is that changing the value of those trackbars will trigger their ValueChanged events. One way you can do this is to temporarily remove the event handlers before you modify the values in code, and then reattach

How to ensure that adjusting a TrackBar control with a mouse will set values multiple of SmallChange and not any in between?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 03:53:46
I used .Net trackbar control. My trackbar point is 0...5...10..15. Problem is, when user scrolled trackbar they easily drop scroll in between points. But i wan't to that user only drop the scroll in my display point only. like they set only 0,5,10 etc. Not they set 6,7,8,9... I set SmallChanges property with 5 value. But they working with keyboard changes not with mouse scrolling. You can simply force the Value property to be a multiple of the SmallChange property by overriding its value in an event handler for the ValueChanged event. Like this: private void trackBar1_ValueChanged(object

WinForms Volume Slider/Trackbar User Control

谁说我不能喝 提交于 2019-12-01 03:10:38
问题 I'm looking for a trackbar-like user/custom control to use in my .NET 2.0 WinForms app. Note: I'm NOT asking how to control the volume in a WinForms app. Anyone knows of a nice looking custom painted slider/trackbar control that could be used in my app to let user set the volume? (such as the ones used in multimedia apps) Ideally, it should support vertical orientation. TIA, 回答1: There is an excellent C# tutorial on how to create your own custom trackbar over at CodeGuru: http://www.codeguru

Track Bar Only fire event on final value not ever time value changes

我怕爱的太早我们不能终老 提交于 2019-11-30 20:42:28
I am working on a pretty basic C# visual studio forms application but am having some issue getting the track bar to act as I want it to so hoping someone in the community might have a solution for this. What I have is a pretty basic application with the main part being a track bar with a value of 0 to 100. The user sets the value of the track to represent "the amount of work to perform" at which point the program reaches out to some devices and tells them to do "x" amount of work (x being the value of the trackbar). So what I do is use the track bars scroll event to catch when the track bars

Track Bar Only fire event on final value not ever time value changes

99封情书 提交于 2019-11-30 04:02:06
问题 I am working on a pretty basic C# visual studio forms application but am having some issue getting the track bar to act as I want it to so hoping someone in the community might have a solution for this. What I have is a pretty basic application with the main part being a track bar with a value of 0 to 100. The user sets the value of the track to represent "the amount of work to perform" at which point the program reaches out to some devices and tells them to do "x" amount of work (x being the

Adding a TrackBar control to a ContextMenu

南楼画角 提交于 2019-11-29 04:56:55
Is it possible to add a TrackBar control to a ContextMenu? So when I right click, my ContextMenu will drop down and a TrackBar will appear as a menu item? If your context menu is a ContexMenuStrip , you can create an item in this way: [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.MenuStrip | ToolStripItemDesignerAvailability.ContextMenuStrip)] public class TrackBarMenuItem : ToolStripControlHost { private TrackBar trackBar; public TrackBarMenuItem():base(new TrackBar()) { this.trackBar = this.Control as TrackBar; } // Add properties, events etc. you want to expose... }