Click here to Skip to main content
15,794,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application where I need to control a Digital to Analogue Converter (DAC) using horizontal trackbar control in VB.Net.
I have used checkbox (appearance: button) to control relays to switch them on and off and I'm sending Ascii values from program to do it.
Is it possible to do the same for trackbar? I am confused because unlike checkbox control which can be given two discrete values I'll need continuous values for trackbar.
I am new to VB.Net so any help will be appreciated.

What I have tried:

I have tried sending ascii values to the trackbar control but it doesn't work.
Updated 8-Jan-17 20:18pm

1 solution

How do you mean 'send ascii values to the trackbar control' ... ? you can set the Value, Minimum and Maximum for a trackbar - this may help Windows Control: The Track Bar[^] notice you're usually using a trackbar to set/get an 'integer' value between a range [min, max]
Share this answer
Member 12609228 9-Jan-17 4:56am    
I need use trackbar to control an external peripheral like knob. Thus, i will require continuous values to be sent via serial communication. I don't want to set minimum or maximum value. I want the values to vary continuously and obtain the corresponding value on the port. My question is, the values to be varied should be ascii values or are they supposed to be some other values? Also, is my approach correct?
Garth J Lancaster 9-Jan-17 5:06am    
1) - you mentioned trackbar - trackbar gives (visual) -> integer results
2) if you vary the trackbar you can use the ValueChanged event to then read the integer value to write to the serial port
3) if the trackbar isnt suitable, you need to get your values from somewhere, use an event or loop to read from some source to write to the serial port

what is the variance in your 'continuous values' ? can you simulate them in a function and output them from a timed loop perhaps ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900