开发者

C# I"m confused with this service routine

So I am using C# with WinForms, My question is what is NewValue in this snippet? e is the event that has occured. So I'm telling the label vsliderecho's text to change to something.

private void V_Slider_Bar_scroll(object sender, SCrollEve开发者_开发百科ntArgs e)
{
    V_Slider_echo.Text= e.NewValue.ToString();
}


If you look up ScrollEventArgs in help, or msdn, then it lists the properties:

NewValue - Gets or sets the new Value of the scroll bar.

ToString() just gets the string value of the new value of the scroll bar, i.e the numerical value of where the bar has moved to.


NewValue is a property of ScrollEventArgs, telling you the new value of the scrollbar.

e isn't the event itself - it's the argument associated with the occurrence of the event, i.e. the information about what's changed in terms of scrolling.

Your event handler just shows the user what the new value of the scrollbar is, basically.


What do you mean exactly? It is an int.

http://msdn.microsoft.com/en-us/library/system.windows.forms.scrolleventargs.newvalue.aspx


The ScrollEventArgs contains information about the event that occured. The NewValue is the value that the scroll bar is currently located at.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜