我创建了一个adorner示例,通知客户端每个组件的使用情况。
我想问的是,如何将控件/装饰器移动到其他组件。
在图片中,当我点击帮助按钮时,它会显示装饰者。如何将装饰器移动到textedit2
紫色方块。使用usercontrol的装饰器。
这是form1代码
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
AdornerUIManager1.ShowGuides = DevExpress.Utils.DefaultBoolean.True
End Sub
Private Sub AdornerUIManager1_QueryGuideFlyoutControl(sender As Object, e As DevExpress.Utils.VisualEffects.QueryGuideFlyoutControlEventArgs) Handles AdornerUIManager1.QueryGuideFlyoutControl
If e.SelectedElement.TargetElement Is Button1 Then
e.Control = New LabelControl() With {
.AllowHtmlString = True,
.Width = 350,
.AutoSizeMode = LabelAutoSizeMode.Vertical,
.Padding = New Padding(20),
.Text = "<b>Navigation Bar</b><br>" & "A side navigation control that supports integration with Office Navigation Bar<br><br>" & "Shows navigation options for your currently selected module"}
End If
If e.SelectedElement.TargetElement Is TextEdit1 Then
Dim x As New UserControl1
x.Label1.Text = "xxXXXxx"
x.WindowsUIButtonPanel1.Buttons(0).Properties.Checked = True
e.Control = x
End If
End Sub
这是用户控制代码
Public Class UserControl1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim x As Form1
x.AdornerUIManager1.Elements(0).TargetElement = x.TextEdit3
End Sub
End Class
当我尝试点击时,出现错误