// Initialize the toolbar private void InitializeToolbar() { toolBar = new ButtonHandler(); // This button resets the paint image GMTextButton resetButton = new GMTextButton(defaultFont, Color.Red); resetButton.GenerateTexture(GraphicsDevice, 20, 20, Color.Black); resetButton.SetText("R"); resetButton.OnClicked += new EventHandler(ResetPaintImage); // This button opens the color picker dialog for the main brush GMTextButton colorPickerButtonMain = new GMTextButton(defaultFont, Color.White); colorPickerButtonMain.GenerateTexture(GraphicsDevice, 20, 20, Color.Red); colorPickerButtonMain.SetText("C"); colorPickerButtonMain.OnClicked += new EventHandler(OpenColorPickerDialogMain); // Put all of the buttons into an array, and add them to the button handler GMTextButton[,] buttonArray = new GMTextButton[1, 2]; buttonArray[0, 0] = resetButton; buttonArray[0, 1] = colorPickerButtonMain; toolBar.AddWithSpacing(buttonArray, new Vector2(5, 20), 5); }