Friday, February 6, 2009

Toolbar in Compact Framework

Toolbar in Compact Framework

To add a toolbar is easy! From the toolbox to add one, then add an imagelist. Assign this imagelist to the toolbar and individual toolbar button.

The problem is: how to hide/show the toolbar?

private void UpdateToolbarVisibility()
{
if (menuItemToolbar.Checked)
{
foreach (ToolBarButton tbb in toolBar.Buttons)
{
tbb.Visible = false;
}
menuItemToolbar.Checked = false;
}
else
{
foreach (ToolBarButton tbb in toolBar.Buttons)
{
tbb.Visible = true;
}
menuItemToolbar.Checked = true;
}
}

Still the position of toolbar cannot be adjusted? How? Still searching.

No comments: