.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 1st, 2005, 05:44 PM
Possibility Possibility is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 Possibility User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 43 sec
Reputation Power: 0
c# newbie questions

Hey,

I have a few questions to ask about various aspects of windows forms with c#.

First off, how do I make a TextBox (or RichTextBox) expand to the size of the form? i.e. I always want the textbox to take up the whole form. I know there is a command for that, but I cannot find it.

Second, how can I open the file browser? I read the MSDN snippert on it, but it won't work. I want to open the file browser when one of my menu items is clicked, and load the selected file into the text box.

Here is the code that I have so far.

Code:
using System;
 using System.Windows.Forms;
 using System.Drawing;
 using System.IO;
 
 class nPad : Form {
 	public nPad() {
 		Text = "nPad";
 		BackColor = Color.LightGray;
 		Size = new Size(300, 300);
 		Location = new Point(20, 20);
 		
 		// Textbox
 		RichTextBox tbox = new RichTextBox();
 		tbox.Size = new Size(290,200);
 		tbox.SelectionFont = new Font("Verdana", 12);
 		Controls.Add(tbox);
 		
 		// Menu
 		MainMenu mnu = new MainMenu();
 		this.Menu = mnu;
 		MenuItem mnuFile = new MenuItem("&File");
 		MenuItem mnuQuit = new MenuItem("&Quit");
 		mnu.MenuItems.Add(mnuFile);
 		mnuFile.MenuItems.Add(mnuQuit);
 		mnuQuit.Click += new EventHandler(mnuQuit_Click);		
 	}
 	
 	public void mnuQuit_Click(object obj, EventArgs ea) {
 		Application.Exit();
 	}
 	
 	public static void Main() {
 		Application.Run(new nPad());
 	}
 }


I know what "public" means before a code section, but what does "static" and "void" mean/do? And what exactly does "object obj" and "EventArghs ea" do?

Thanks!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > c# newbie questions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway