Je ne me suis pas soucié des panneaux, de l'ancrage ou des ancrages. J'ai simplement jeté ensemble un contrôle ToolBar (pas ToolStrip) et semble incapable de le dimensionner.Comment redimensionner un System.Windows.Forms.ToolBar?
System.Windows.Forms.ToolBar tb = new System.Windows.Forms.ToolBar();
// Reports 292x28 (approx) if I check width and height
// Basically the width of the form and I assume a default height
tb.Size = new System.Drawing.Size(195, 48);
// Reports 48x48, but does not actually create buttons of that size
// (It reports 48x48 because I'm retrieving 48x48 icons from a ResourceManager (resx))
tb.ButtonSize = new System.Drawing.Size(48, 48); //
Le plus proche chose que je trouve à faire mon plus grand ToolBar était:
http://bytes.com/topic/c-sharp/answers/241614-changing-height-toolbar-button
Bien qu'il soit plutôt daté. Et je ne l'ai pas compris. Les ToolBarButtons n'ont pas de propriétés Height, Width ou Size. J'utilise SharpDevelop, codant complètement à la main sur Vista, avec tous les frameworks .NET.
EDIT:
Voici le code EXACT que je suis actuellement en utilisant.
#region ImageList/Toolbar
ImageList toolbarImages = new ImageList();
Image wizardToolbarImage = (Bitmap) rm.GetObject("wizard");
Image optionsToolbarImage = (Bitmap) rm.GetObject("configure");
toolbarImages.Images.Add(wizardToolbarImage);
toolbarImages.Images.Add(optionsToolbarImage);
ToolBar toolbarMain = new ToolBar();
toolbarMain.Size = new Size(195, 25); // no effect
ToolBarButton wizardToolbarButton = new ToolBarButton();
ToolBarButton optionsToolbarButton = new ToolBarButton();
wizardToolbarButton.ImageIndex = 0;
wizardToolbarButton.ToolTipText = "Wizard!";
optionsToolbarButton.ImageIndex = 1;
optionsToolbarButton.ToolTipText = "Options!";
toolbarMain.Buttons.Add(wizardToolbarButton);
toolbarMain.Buttons.Add(optionsToolbarButton);
toolbarMain.Appearance = ToolBarAppearance.Normal;
toolbarMain.ButtonSize = new System.Drawing.Size(48, 48); // no effect
toolbarMain.ImageList = toolbarImages;
toolbarMain.ButtonClick += new ToolBarButtonClickEventHandler(toolbarMain_Click);
Controls.Add(toolbarMain);
#endregion
Serait-il possible pour vous de me donner un exemple de code pour la comparaison alors? Comme c'est, les miens sont BEAUCOUP plus petit que 48x48. Je vais ajouter un peu plus du code à l'original pour illustrer tout ce que je fais. – Brainsick