Click here to Skip to main content
12,064,338 members (44,472 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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 2:55am
Code-Hunt7.1K
Edited 8-Jan-13 2: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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160204.4 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2016
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