slider
slider
slider
slider
slider
slider slider slider slider slider slider slider slider
slider slider
slider
Go Back  Xtreme Visual Basic Talk > > > slider


Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2011, 01:37 PM
andrebr andrebr is offline
Newcomer
 
Join Date: May 2010
Posts: 13
Exclamation slider


Hi guys.
I'm trying to find a script to create a slider button.

Annyone have a scirpt? (Visual basic 2010)

-Andy


Attached image is similare to what I want..
Attached Images
File Type: gif slider.gif (13.5 KB, 10 views)
Reply With Quote
  #2  
Old 02-04-2011, 02:49 PM
AtmaWeapon's Avatar
AtmaWeaponslider AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

<sarcasm>
Using a script to write the code for you seems like a roundabout approach; wouldn't you rather just write the code in the first place?

("Script" tends to refer to source files for interpreted languages like Perl, Ruby, Python, and VBScript. These are different beasts than compiled languages like VB .NET, where the source files are usually referred to as "source" or "code" or (if you want to be mocked) "codes". I'm in a cheeky mood because it's a snow day so I couldn't help myself.)
</sarcasm>
Your best bet is going to be to find someone selling a control like what you want. That way someone else does all the work and is on the hook for features. It's quick and it's easy.

The next best thing is to do a web search for 30 minutes or so to see if there's a free one you can use or if someone's written an article that implements one. Don't cheat yourself and ignore C#; if it's in C# you can put it in a DLL and use it from VB .NET.

The next step is to write it from scratch. The difficulty here is wholly reliant on whether you want to use Windows Forms or WPF.

If you want to use WinForms, you'll have to be pretty familiar with inheritance, the Paint event, and the System.Drawing.Graphics class in addition to a myriad of other classes in System.Drawing. Your task will be to derive a brand new class from Control and override the painting logic to achieve the look you want. You'll have to include mechanisms for hit testing, dragging the slider, updating the value, enforcing minimum/maximum, etc. I'd say it's 3-6 hours of work for an unpolished prototype.

If you want to use WPF, it's pretty trivial if you're already familiar with templating. WPF controls were made to be redesigned and have a Template property that represents the "look" of the control. Replace the template and you have yourself a restyled control. Alternatively, you can sometimes fiddle with styles to get what you want. System.Windows.Controls.Slider is already close. You'd need to trim its default template a bit to get a simple prototype working, but it's just a matter of replacing key parts. For example, the style "SliderThumbStyle" represents the "thumb" (the part you drag) and comes with a lot of plumbing related to animations you could drop for a prototype. I'd include an example, but I'm inexperienced and a little busy. I'd say it'd be 1-2 hours of work to get an unpolished prototype and 3-6 until something nice emerged.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #3  
Old 02-04-2011, 03:04 PM
andrebr andrebr is offline
Newcomer
 
Join Date: May 2010
Posts: 13
Default Thanks

Hi again Atma.
Thanks for your help in serial communications. I got it to work superb.

And yes. This is a WinForm. I'll take your advice under consideration, and take it from there.

Best,
Andy
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
slider
slider
slider slider
slider
slider
slider slider slider slider slider slider slider
slider
slider
 
slider
slider
 
-->