1

在我的应用程序中,通过连接到数据库,按钮添加到RadScrollablePanel。在另一个列表中,按钮的名称可用。当用户单击并从列表 2 中选择时,我想选择 RadScrollablePanel 中的按钮。我通过这段代码找到了按钮:

System.Windows.Forms.Control[] _controls = MainForm.Controls.Find(PointId.ToString(), true);
foreach (var itemButton in _controls)
{
    if (itemButton.Name == PointId.ToString())
    {
        if (BLL.PropertiesClass.LastFocusedExplorerbarItem != null)
            BLL.PropertiesClass.LastFocusedExplorerbarItem.BackColor = Color.AliceBlue;
        itemButton.BackColor = Color.FromArgb(0x4F, 0x00, 0x60, 0xFF);
        BLL.PropertiesClass.LastFocusedExplorerbarItem = itemButton;
        /* Which Method I Do This*/
        break;
    }
}

我测试PerformLayoutScrollControlIntoView但面板不在那里滚动。

4

1 回答 1

1

我使用这段代码:

itemButton.Focus();
itemButton.Select();
PanelOfEachGroup.ScrollControlIntoView(MainForm.ActiveControl);
于 2012-10-07T14:31:57.223 回答