Trackbars in VB.

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Trackbars in VB.

Post by Patrickh »

How do I code for the trackbar, in such a way that when it is set to tick 1, opacity = 25, 2 = 50, or whatever. I just don't understand how to code for the trackbar. Thanks
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

I don't use trackbars so I don't know for sure, but it would involve using an event handler for ontrackbarchange or something, and you would then put opacity = (25 * trackbar.index)
User avatar
dos mes





Posts: 2158
Joined: Thu Dec 29, 2005 9:58 pm
Location: Syracuse, NY

Post by dos mes »

Under the trackbar scroll event handler:

Code: Select all

this.opacity = .1 * trackbar.value;
for vb, just change 'this' to 'me' and remove the semicolon
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Post by Prey »

Code: Select all

// trackbar1.Maximum = 99, set to 100 and you'll see some crappy black stuff when going from 100 to 99

private void trackBar1_Scroll(object sender, EventArgs e)
{
    this.Opacity = trackBar1.Value * 0.01;
}
Edit: Yeaa^^
~He asked for VB, not C#
I know.
Last edited by Prey on Fri Jul 06, 2007 9:37 am, edited 1 time in total.
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

thanks guys, that worked :wink: .
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
Post Reply