【发布时间】:2014-02-23 04:24:06
【问题描述】:
我想设置列表框位置。在 Winform 中,我使用此代码 listbox.Location 做到了这一点,但在 WPF 中没有 listbox.Location 属性。
编辑 1:
var rect = txtBox.GetRectFromCharacterIndex(txtBox.CaretIndex);
var point = rect.BottomRight;
lstBox1.Visibility = Visibility.Visible;
//Want to achieved this
//TextBox.Location = point;
我正在用列表框创建类似 Intellisense 的东西
【问题讨论】:
-
请添加您的代码,而不是位置,尝试使用 Margin 属性
-
你不能使用winforms相同的原理。
-
我想在列表框的 Y 轴上输入点值。
-
请看我下面的帖子——边距有四个部分:左、上、右、下。你可以喂那个。左为 X,上为 Y。
标签: c# wpf wpf-controls