create Graphic frequency Equalizer
-
Tuesday, February 19, 2008 5:33 PMDear friend,
i am using vb.net2005 express edition
is this possible to create Graphic frequency Equalizer in vb.net.becos i am doing vibration monitoring system project.so i need to create Graphic frequency Equalizer .so i have to build scrolable control to increase and decrese the frequency values using the contol..is this possible to create in vb.net if means please show me if there is any link or example for this please
All Replies
-
Wednesday, February 20, 2008 11:20 AM
Hi B2A,
Use TrackBar rather than a scrollbar. You could have a row of track bars each oriented vertically, set min and max values and set the tick mark spacing and tick style. Then attach the scroll event to get its value to send to the vibration rig controller.
Code Snippet- Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
- TextBox1.Text = TrackBar1.Value
- End Sub
- Proposed As Answer by Tim Mathias Wednesday, October 14, 2009 7:52 PM
- Edited by Tim Mathias Thursday, October 15, 2009 3:14 PM Reformatted code snippet.
-
Wednesday, February 20, 2008 2:48 PMDear friend,
Actually i need to fill red color inside VScrollbar.is it possible to use. becos while scrolling the intensity of the redcolor has to change .but i have use one control for both(scrolling and filling color inside the scrollbar). please help me to achieve this please -
Wednesday, February 20, 2008 3:24 PM
Try these:
System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar
System.Windows.Forms.TrackBarRenderer
System.Windows.Forms.TrackBarRenderer.DrawVerticalTrack(ByVal System.Drawing.Graphics, ByVal System.Drawing.Rectangle)
Or set the BackColor:
Code Snippet- Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * 255, 0, 0)
- End Sub
- Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
- TextBox1.Text = TrackBar1.Value
- TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * 255, 0, 0)
- End Sub
- Proposed As Answer by Tim Mathias Wednesday, October 14, 2009 7:52 PM
- Edited by Tim Mathias Thursday, October 15, 2009 3:01 PM Reformatted code snippet.
-
Wednesday, February 20, 2008 5:25 PMDear Friend,
thanks a lot for your genius reply.i run your code. but it shows redcolor.is it possible to bring all the colors in back of trackbar? so depends the color intesity change. is this possible?if means please let me know the way.pls show some sample code please -
Wednesday, February 20, 2008 6:34 PM
You initially said you wanted to change the redcolor, but now you want the other colors back in. I'm not sure what that means. There are an infinite number of colour variations. It's up to you to fine tune exactly how you want it to look. So moving from the realm of genius code to genius art, here's few suggestions:
Code Snippet- Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- TrackBar1SetBackColor()
- End Sub
- Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
- TextBox1.Text = TrackBar1.Value
- TrackBar1SetBackColor()
- End Sub
- Private Sub TrackBar1SetBackColor()
- 'TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * 255, 0, 0)
- 'TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * 127 + 128, 0, 0)
- 'TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * 127 + 128, 128, 128)
- 'TrackBar1.BackColor = Color.FromArgb(255, 255 - TrackBar1.Value / TrackBar1.Maximum * 255, 255 - TrackBar1.Value / TrackBar1.Maximum * 255)
- TrackBar1.BackColor = Color.FromArgb(SystemColors.Control.R, SystemColors.Control.G - TrackBar1.Value / TrackBar1.Maximum * SystemColors.Control.G, SystemColors.Control.B - TrackBar1.Value / TrackBar1.Maximum * SystemColors.Control.B)
- End Sub
The colours are a combination of Alpha (opacity), Red, Green and Blue. It's like an artist's pallette. It's up to you how you mix them.
- Proposed As Answer by Tim Mathias Wednesday, October 14, 2009 7:52 PM
- Edited by Tim Mathias Thursday, October 15, 2009 3:05 PM Reformatted code snippet.
-
Wednesday, February 20, 2008 6:47 PM
Here's another suggestion:
Code Snippet- TrackBar1.BackColor = Color.FromArgb(TrackBar1.Value / TrackBar1.Maximum * (255 - SystemColors.Control.R) + SystemColors.Control.R, SystemColors.Control.G - TrackBar1.Value / TrackBar1.Maximum * SystemColors.Control.G, SystemColors.Control.B - TrackBar1.Value / TrackBar1.Maximum * SystemColors.Control.B)
- Debug.Print(TrackBar1.BackColor.ToString())
Run it in debug mode (F5) to see the list of colours in the Intermediate Window (Ctrl+G).
- Proposed As Answer by Tim Mathias Wednesday, October 14, 2009 7:52 PM
- Edited by Tim Mathias Thursday, October 15, 2009 3:09 PM Reformatted code snippet.
-
Thursday, February 21, 2008 9:46 AM


