ScrollEventArgs 클래스
정의
Scroll
이벤트에 대한 데이터를 제공합니다.Provides data for the Scroll
event.
public ref class ScrollEventArgs : EventArgs
public class ScrollEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class ScrollEventArgs : EventArgs
type ScrollEventArgs = class
inherit EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type ScrollEventArgs = class
inherit EventArgs
Public Class ScrollEventArgs
Inherits EventArgs
- 상속
- 특성
예제
다음 코드 예제에서는이 멤버를 사용 하는 방법을 보여 줍니다.The following code example demonstrates the use of this member.
void AddMyScrollEventHandlers()
{
// Create and initialize a VScrollBar.
VScrollBar^ vScrollBar1 = gcnew VScrollBar;
// Add event handlers for the OnScroll and OnValueChanged events.
vScrollBar1->Scroll += gcnew ScrollEventHandler( this, &Form1::vScrollBar1_Scroll );
vScrollBar1->ValueChanged += gcnew EventHandler( this, &Form1::vScrollBar1_ValueChanged );
}
// Create the ValueChanged event handler.
void vScrollBar1_ValueChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Display the new value in the label.
label1->Text = String::Format( "vScrollBar Value:(OnValueChanged Event) {0}", vScrollBar1->Value );
}
// Create the Scroll event handler.
void vScrollBar1_Scroll( Object^ /*sender*/, ScrollEventArgs^ e )
{
// Display the new value in the label.
label1->Text = String::Format( "VScrollBar Value:(OnScroll Event) {0}", e->NewValue );
}
void button1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Add 40 to the Value property if it will not exceed the Maximum value.
if ( vScrollBar1->Value + 40 < vScrollBar1->Maximum )
{
vScrollBar1->Value = vScrollBar1->Value + 40;
}
}
private void AddMyScrollEventHandlers()
{
// Create and initialize a VScrollBar.
VScrollBar vScrollBar1 = new VScrollBar();
// Add event handlers for the OnScroll and OnValueChanged events.
vScrollBar1.Scroll += new ScrollEventHandler(
this.vScrollBar1_Scroll);
vScrollBar1.ValueChanged += new EventHandler(
this.vScrollBar1_ValueChanged);
}
// Create the ValueChanged event handler.
private void vScrollBar1_ValueChanged(Object sender,
EventArgs e)
{
// Display the new value in the label.
label1.Text = "vScrollBar Value:(OnValueChanged Event) " + vScrollBar1.Value.ToString();
}
// Create the Scroll event handler.
private void vScrollBar1_Scroll(Object sender,
ScrollEventArgs e)
{
// Display the new value in the label.
label1.Text = "VScrollBar Value:(OnScroll Event) " + e.NewValue.ToString();
}
private void button1_Click(Object sender,
EventArgs e)
{
// Add 40 to the Value property if it will not exceed the Maximum value.
if (vScrollBar1.Value + 40 < vScrollBar1.Maximum)
{
vScrollBar1.Value = vScrollBar1.Value + 40;
}
}
Private Sub AddMyScrollEventHandlers()
' Create and initialize a VScrollBar.
Dim vScrollBar1 As New VScrollBar()
' Add event handlers for the OnScroll and OnValueChanged events.
AddHandler vScrollBar1.Scroll, AddressOf Me.vScrollBar1_Scroll
AddHandler vScrollBar1.ValueChanged, AddressOf Me.vScrollBar1_ValueChanged
End Sub
' Create the ValueChanged event handler.
Private Sub vScrollBar1_ValueChanged(sender As Object, e As EventArgs)
' Display the new value in the label.
label1.Text = "vScrollBar Value:(OnValueChanged Event) " & _
vScrollBar1.Value.ToString()
End Sub
' Create the Scroll event handler.
Private Sub vScrollBar1_Scroll(sender As Object, e As ScrollEventArgs)
' Display the new value in the label.
label1.Text = "VScrollBar Value:(OnScroll Event) " & _
e.NewValue.ToString()
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
' Add 40 to the Value property if it will not exceed the Maximum value.
If vScrollBar1.Value + 40 < vScrollBar1.Maximum Then
vScrollBar1.Value = vScrollBar1.Value + 40
End If
End Sub
설명
이 Scroll
이벤트는 사용자가 스크롤 막대의 값을 변경할 때 발생 합니다.The Scroll
event occurs when the user changes the value of the scroll bar. 이 이벤트는 스크롤 막대 화살표를 클릭 하거나 위쪽 화살표 또는 아래쪽 화살표를 누르거나 스크롤 상자를 끌어와 같은 다양 한 동작으로 인해 발생할 수 있습니다.This event can result from a variety of actions, such as clicking a scroll bar arrow, pressing the UP ARROW or DOWN ARROW, or dragging the scroll box. 는 ScrollEventArgs 발생 한 스크롤 이벤트의 형식과 스크롤 막대의 새 값을 지정 합니다.The ScrollEventArgs specifies the type of scroll event that occurred and the new value of the scroll bar. 속성을 사용 ScrollOrientation 하 여 이벤트에 대 한 스크롤 막대 방향을 결정 합니다 Scroll
.Use the ScrollOrientation property to determine the scroll bar orientation for the Scroll
event.
Scroll
이 이벤트는,, DataGridView ScrollableControl ScrollBar 및 컨트롤에 대해 발생 합니다 DataGrid .The Scroll
event occurs for the DataGridView, ScrollableControl, ScrollBar, and DataGrid controls.
생성자
ScrollEventArgs(ScrollEventType, Int32) |
ScrollEventArgs 및 Type 속성에 주어진 값을 사용하여 NewValue 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ScrollEventArgs class using the given values for the Type and NewValue properties. |
ScrollEventArgs(ScrollEventType, Int32, Int32) |
ScrollEventArgs, Type 및 OldValue 속성에 주어진 값을 사용하여 NewValue 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, OldValue, and NewValue properties. |
ScrollEventArgs(ScrollEventType, Int32, Int32, ScrollOrientation) |
ScrollEventArgs, Type, OldValue 및 NewValue 속성에 주어진 값을 사용하여 ScrollOrientation 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, OldValue, NewValue, and ScrollOrientation properties. |
ScrollEventArgs(ScrollEventType, Int32, ScrollOrientation) |
ScrollEventArgs, Type 및 NewValue 속성에 주어진 값을 사용하여 ScrollOrientation 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, NewValue, and ScrollOrientation properties. |
속성
NewValue |
스크롤 막대의 새 Value를 가져오거나 설정합니다.Gets or sets the new Value of the scroll bar. |
OldValue |
스크롤 막대의 이전 Value를 가져옵니다.Gets the old Value of the scroll bar. |
ScrollOrientation |
|
Type |
발생한 스크롤 이벤트의 종류를 가져옵니다.Gets the type of scroll event that occurred. |
메서드
Equals(Object) |
지정된 개체가 현재 개체와 같은지 확인합니다.Determines whether the specified object is equal to the current object. (다음에서 상속됨 Object) |
GetHashCode() |
기본 해시 함수로 작동합니다.Serves as the default hash function. (다음에서 상속됨 Object) |
GetType() |
현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance. (다음에서 상속됨 Object) |
MemberwiseClone() |
현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object. (다음에서 상속됨 Object) |
ToString() |
현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object. (다음에서 상속됨 Object) |