Click here to Skip to main content
16,005,236 members
Home / Discussions / C#
   

C#

 
GeneralRe: Building a class and interacting with GUI Pin
apricotsun18-Mar-07 3:51
apricotsun18-Mar-07 3:51 
GeneralRe: Building a class and interacting with GUI Pin
apricotsun18-Mar-07 4:03
apricotsun18-Mar-07 4:03 
Questionopening clicked file in my program Pin
dsl/fahk17-Mar-07 17:26
dsl/fahk17-Mar-07 17:26 
AnswerRe: opening clicked file in my program Pin
Stefan Troschuetz17-Mar-07 22:38
Stefan Troschuetz17-Mar-07 22:38 
QuestionNew to ToolStrip, simple question. Pin
Neal Conrardy17-Mar-07 17:20
Neal Conrardy17-Mar-07 17:20 
AnswerRe: New to ToolStrip, simple question. Pin
Christian Graus17-Mar-07 18:28
protectorChristian Graus17-Mar-07 18:28 
GeneralRe: New to ToolStrip, simple question. Pin
Neal Conrardy18-Mar-07 5:43
Neal Conrardy18-Mar-07 5:43 
GeneralRe: New to ToolStrip, simple question. Pin
Neal Conrardy18-Mar-07 6:34
Neal Conrardy18-Mar-07 6:34 
Here is an update. I used the auto stuff in .NET for making a form and got the same results. It seems the OnPaint for the client area is being called for the ToolStrip. I just assumed ToolStrip would have it's on OnPaint method.

Here is my entire constructor. I am a fairly new to the C# stuff and this is my learning program. I did not want to use the auto stuff in .NET until I made an application by "hand".



public GLA()
{
Text = "GLA";
programName = Text;

BackColor = SystemColors.Window;
ForeColor = SystemColors.WindowText;
ResizeRedraw = true;

Icon = new Icon(GetType(), "GLA.ico");

// Status bar.

statusBarPanel = new StatusBarPanel();
statusBarPanel.AutoSize = StatusBarPanelAutoSize.Contents;

statusBar = new StatusBar();
statusBar.Parent = this;
statusBar.ShowPanels = true;

statusBar.Panels.Add(statusBarPanel);

// Tool bar.

ToolStrip toolStrip = new ToolStrip();

ToolStripButton toolStripFileOpen = new ToolStripButton("Open", new Bitmap("openHS.png"), new EventHandler(MenuFileOpenOnClick), "Open");
ToolStripButton toolStripFileSave = new ToolStripButton("Save", new Bitmap("saveHS.png"), new EventHandler(MenuFileSaveOnClick), "Save");

toolStripFileOpen.DisplayStyle = ToolStripItemDisplayStyle.Image;
toolStripFileSave.DisplayStyle = ToolStripItemDisplayStyle.Image;

ToolStripSeparator toolStripSeparator = new ToolStripSeparator();

toolStrip.Items.Add(toolStripFileOpen);
toolStrip.Items.Add(toolStripFileSave);
toolStrip.Items.Add(toolStripSeparator);

Controls.Add(toolStrip);

// Menus.

menu = new MenuStrip();

menuFile = new ToolStripMenuItem("&File" );

menuFileOpen = new ToolStripMenuItem("&Open..." , new Bitmap("openHS.png"), new EventHandler(MenuFileOpenOnClick ), Keys.Control | Keys.O);
menuFileSave = new ToolStripMenuItem("&Save" , new Bitmap("saveHS.png"), new EventHandler(MenuFileSaveOnClick ), Keys.Control | Keys.S);
menuFileSaveAs = new ToolStripMenuItem("Sa&ve As..." , null , new EventHandler(MenuFileSaveAsOnClick), Keys.Control | Keys.V);
menuFileExit = new ToolStripMenuItem("&Exit" , null , new EventHandler(MenuFileExitOnClick ), Keys.Control | Keys.E);

menuHelp = new ToolStripMenuItem("&Help" );
menuHelpAbout = new ToolStripMenuItem("&About" , new Bitmap("GLA.ico" ), new EventHandler(MenuHelpAboutOnClick ), Keys.Control | Keys.A);

menuSeparator = new ToolStripSeparator();

menuFileOpen .AutoToolTip = true; menuFileOpen .ToolTipText = "Open a file to edit or view" ;
menuFileSave .AutoToolTip = true; menuFileSave .ToolTipText = "Save the current data set" ;
menuFileSaveAs.AutoToolTip = true; menuFileSaveAs.ToolTipText = "Save data set with a different name";
menuFileExit .AutoToolTip = true; menuFileExit .ToolTipText = "Exit the program" ;

// Add items to the main menu.

menu.Items.Add(menuFile);

menuFile.DropDownItems.Add(menuFileOpen );
menuFile.DropDownItems.Add(menuFileSave );
menuFile.DropDownItems.Add(menuFileSaveAs);
menuFile.DropDownItems.Add(menuSeparator );
menuFile.DropDownItems.Add(menuFileExit );

menu.Items.Add(menuHelp);

menuHelp.DropDownItems.Add(menuHelpAbout );

// Add the list of controls.

Controls.Add(menu);

// Assign the menu to the form.

MainMenuStrip = menu;

// Disable Save and SaveAs since there is no file open.

menuFileSave .Enabled = false;
menuFileSaveAs.Enabled = false;
}



QuestionRe: New to ToolStrip, simple question. Pin
Neal Conrardy18-Mar-07 8:34
Neal Conrardy18-Mar-07 8:34 
AnswerRe: New to ToolStrip, simple question. Pin
Neal Conrardy18-Mar-07 16:50
Neal Conrardy18-Mar-07 16:50 
QuestionRe: New to ToolStrip, simple question. Pin
Neal Conrardy19-Mar-07 10:20
Neal Conrardy19-Mar-07 10:20 
AnswerRe: New to ToolStrip, simple question. Pin
Neal Conrardy20-Mar-07 7:46
Neal Conrardy20-Mar-07 7:46 
QuestionFTP Pin
bwagz17-Mar-07 16:44
bwagz17-Mar-07 16:44 
AnswerRe: FTP Pin
Ryno Burger17-Mar-07 21:15
Ryno Burger17-Mar-07 21:15 
QuestionC# threads and graphics Pin
bruceczelenka17-Mar-07 15:36
bruceczelenka17-Mar-07 15:36 
AnswerRe: C# threads and graphics Pin
Christian Graus17-Mar-07 18:12
protectorChristian Graus17-Mar-07 18:12 
Questionc# App - Vista Changes UI Colors Pin
rbirkelbach17-Mar-07 12:35
rbirkelbach17-Mar-07 12:35 
AnswerRe: c# App - Vista Changes UI Colors Pin
Ed.Poore19-Mar-07 12:51
Ed.Poore19-Mar-07 12:51 
QuestionXOR problem Pin
HexaDeveloper17-Mar-07 11:40
HexaDeveloper17-Mar-07 11:40 
AnswerRe: XOR problem Pin
mav.northwind17-Mar-07 12:49
mav.northwind17-Mar-07 12:49 
GeneralRe: XOR problem Pin
HexaDeveloper17-Mar-07 22:12
HexaDeveloper17-Mar-07 22:12 
GeneralRe: XOR problem Pin
HexaDeveloper18-Mar-07 9:29
HexaDeveloper18-Mar-07 9:29 
GeneralRe: XOR problem Pin
HexaDeveloper19-Mar-07 13:10
HexaDeveloper19-Mar-07 13:10 
QuestionUninstall Pin
hadad17-Mar-07 11:15
hadad17-Mar-07 11:15 
AnswerRe: Uninstall Pin
Christian Graus17-Mar-07 18:30
protectorChristian Graus17-Mar-07 18:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.