Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows VB.NET
Hi all
 
I have one button and a trackbar..
please tell me in scroll event of that trackbar what i have to write to increase and decrease the size of the button
 
Thnk you
Posted 8-Jan-13 1:55am
Edited 8-Jan-13 1:56am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use the ValueChanged event instead.
Set the TrackBar.Minimum to the smallest size of the Button, set the Maximum to the largest.
In the ValueChanged Event:
private void myTrackBar_ValueChanged(object sender, EventArgs e)
    {
    TrackBar tb = sender as TrackBar;
    if (tb != null)
        {
        myBubuttonToResize.Width = tb.Value;
        }
    }
[edit]Missed the VB bit! - OriginalGriff[/edit]
 
Private Sub myTrackBar_ValueChanged(sender As Object, e As EventArgs)
    Dim tb As TrackBar = TryCast(sender, TrackBar)
    If tb IsNot Nothing Then
        myBubuttonToResize.Width = tb.Value
    End If
End Sub
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100