DesignerRegionMouseEventArgs.Region Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the designer region that was clicked, if any.
public:
property System::Web::UI::Design::DesignerRegion ^ Region { System::Web::UI::Design::DesignerRegion ^ get(); };
public System.Web.UI.Design.DesignerRegion Region { get; }
member this.Region : System.Web.UI.Design.DesignerRegion
Public ReadOnly Property Region As DesignerRegion
Property Value
The DesignerRegion that the click event applies to, or null
if no region was clicked.
Examples
The following code example shows how to use the DesignerRegionMouseEventArgs to identify the region that was clicked and to change view accordingly. This example is part of a larger example provided for the EditableDesignerRegion class.
// Handler for the Click event, which provides the region in the arguments.
protected override void OnClick(DesignerRegionMouseEventArgs e)
{
if (e.Region == null)
return;
// If the clicked region is not a header, return
if (e.Region.Name.IndexOf("Header") != 0)
return;
// Switch the current view if required
if (e.Region.Name.Substring(6, 1) != myControl.CurrentView.ToString())
{
myControl.CurrentView = int.Parse(e.Region.Name.Substring(6, 1));
base.UpdateDesignTimeHtml();
}
}
' Handler for the Click event, which provides the region in the arguments.
Protected Overrides Sub OnClick(ByVal e As DesignerRegionMouseEventArgs)
If IsNothing(e.Region) Then
Return
End If
' If the clicked region is not a header, return
If e.Region.Name.IndexOf("Header") <> 0 Then
Return
End If
' Switch the current view if required
If e.Region.Name.Substring(6, 1) <> myControl.CurrentView.ToString() Then
myControl.CurrentView = Integer.Parse(e.Region.Name.Substring(6, 1))
MyBase.UpdateDesignTimeHtml()
End If
End Sub
Remarks
The Region property represents the control designer region that was clicked, if any.
The Region property is initialized by the DesignerRegionMouseEventArgs constructor.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기