Hello dear Supporters,
i would like to change the size of the buttons which are assoziated with some actions
which i inserted in a ViewController and the according DetailView
public partial class WinCustomizeActionButtonsViewController : ViewController
{
public WinCustomizeActionButtonsViewController()
{
InitializeComponent();
RegisterActions(components);
TargetObjectType = typeof(Pruefung);
}
protected override void OnActivated()
{
base.OnActivated();
foreach (WinActionContainerViewItem item in ((DetailView)View).GetItems<WinActionContainerViewItem>())
{
if (item.Id == "CertWPSActions")
{
item.ControlCreated += item_ControlCreated;
IModelActionContainerViewItem q = (item.Model as IModelActionContainerViewItem);
}
}
}
private void item_ControlCreated(object sender, EventArgs e)
{
((ButtonsContainer)((ViewItem)(sender)).Control).ActionItemAdding += CustomizeWinActionContainerViewItemController_ActionItemAdding;
((ButtonsContainer)((ViewItem)(sender)).Control).SizeConstraints = SizeConstraints.None;
}
void CustomizeWinActionContainerViewItemController_ActionItemAdding(object sender, ActionItemEventArgs e)
{
if (e.Item.Action.Id.Contains("WPS"))
{
SimpleButton button = (((ButtonsContainersSimpleActionItem)e.Item).Control) as SimpleButton;
if (button != null)
{
if (!string.IsNullOrEmpty(e.Item.Action.Model.ImageName))
button.Image = ImageLoader.Instance.GetSmallImageInfo(e.Item.Action.Model.ImageName).Image;
//button.Font = new Font(button.Font, FontStyle.Bold);
//(sender as ButtonsContainer).Con
button.Width = 40;
The Size of the button is not changeable…
//(e.Item.LayoutView as LayoutControlItem).SizeConstraintsType = SizeConstraintsType.Custom;
}
}
}
Is anybody able to give me a hint for that?
Your Thomas
I think that is a problem with the LayoutControl which is used to 'show' WinActionContainerViewItem…
It seems not trival to find a 'Setting' to be able to control the button size in a Layoutcontrol.
Thomas