Click here to Skip to main content
15,900,907 members
Home / Discussions / C#
   

C#

 
GeneralRe: my drawing disappear Pin
xiaowenjie7-Oct-04 3:47
xiaowenjie7-Oct-04 3:47 
GeneralRe: my drawing disappear Pin
Heath Stewart7-Oct-04 7:28
protectorHeath Stewart7-Oct-04 7:28 
GeneralRe: my drawing disappear Pin
xiaowenjie20-Oct-04 20:14
xiaowenjie20-Oct-04 20:14 
GeneralRe: my drawing disappear Pin
Heath Stewart20-Oct-04 21:46
protectorHeath Stewart20-Oct-04 21:46 
GeneralAccessing an object created by another class Pin
NietzscheDisciple6-Oct-04 15:59
NietzscheDisciple6-Oct-04 15:59 
GeneralRe: Accessing an object created by another class Pin
Christian Graus6-Oct-04 16:27
protectorChristian Graus6-Oct-04 16:27 
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 17:21
NietzscheDisciple6-Oct-04 17:21 
GeneralRe: Accessing an object created by another class Pin
Tom Clement6-Oct-04 17:59
professionalTom Clement6-Oct-04 17:59 
Maybe I'm missing something here, but it seems that you're trying to obtain an event from your user control that contains the trackbar. I don't really know why you need the separate UserControl, since you could just place the trackbar on the form, but if you have to do that, you'll need to declare a public event on the UserControl, then create an event handler in your form. In the user control, you would handle the value changed event (whatever that is) from the track bar, and raise the event.

The .NET documentation indicates a pretty straightforward design pattern for this. Assuming your event is ValueChanged you typically declare a method:

private void OnValueChanged()
{
if( ValueChanged != null ) ValueChanged(this, EventArgs.Empty);
}

In the event handler for the trackbar event, call this method.

You'll also need to expose a public property that tells you where the progress bar is, so that in your form, when you respond to the event you can read the value and pass it to your SecBuff.

All that said, really, it would be much easier just to site the track bar on the form and respond to its value changed event by passing the current track bar position into the SecBuff.


Another approach you could take would be to pass the SecBuff object into your user control as a property, then respond to the value changed event on the track bar by setting the corresponding value on the SecBuff object.

Tom Clement
Apptero, Inc.
www.apptero.com

articles[^]
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 18:14
NietzscheDisciple6-Oct-04 18:14 
GeneralRe: Accessing an object created by another class Pin
NietzscheDisciple6-Oct-04 18:42
NietzscheDisciple6-Oct-04 18:42 
GeneralRe: Accessing an object created by another class Pin
Tom Clement6-Oct-04 19:07
professionalTom Clement6-Oct-04 19:07 
GeneralControls related question Pin
NietzscheDisciple6-Oct-04 15:08
NietzscheDisciple6-Oct-04 15:08 
GeneralRe: Controls related question Pin
Christian Wikander6-Oct-04 21:12
Christian Wikander6-Oct-04 21:12 
GeneralPasswordAge from LDAP Pin
Andy *M*6-Oct-04 12:11
Andy *M*6-Oct-04 12:11 
GeneralRe: PasswordAge from LDAP Pin
Heath Stewart6-Oct-04 19:44
protectorHeath Stewart6-Oct-04 19:44 
GeneralRe: PasswordAge from LDAP Pin
Andy *M*6-Oct-04 23:38
Andy *M*6-Oct-04 23:38 
GeneralRe: PasswordAge from LDAP Pin
Heath Stewart7-Oct-04 7:10
protectorHeath Stewart7-Oct-04 7:10 
Generalcustom property Pin
Grammel6-Oct-04 11:20
Grammel6-Oct-04 11:20 
GeneralRe: custom property Pin
Heath Stewart6-Oct-04 12:33
protectorHeath Stewart6-Oct-04 12:33 
GeneralRe: custom property Pin
leppie7-Oct-04 0:16
leppie7-Oct-04 0:16 
GeneralRe: custom property Pin
Grammel7-Oct-04 0:32
Grammel7-Oct-04 0:32 
GeneralC# Datagrid link column target Pin
perms6-Oct-04 11:15
perms6-Oct-04 11:15 
GeneralRe: C# Datagrid link column target Pin
Heath Stewart6-Oct-04 14:51
protectorHeath Stewart6-Oct-04 14:51 
Questionhow can i arrange data alphabetically? Pin
visiontec6-Oct-04 11:07
visiontec6-Oct-04 11:07 
AnswerRe: how can i arrange data alphabetically? Pin
Heath Stewart6-Oct-04 14:07
protectorHeath Stewart6-Oct-04 14:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.