Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can anybody explain me how does casting work *internally*? Pin
Sebastian Schneider25-Aug-04 5:12
Sebastian Schneider25-Aug-04 5:12 
GeneralRe: Can anybody explain me how does casting work *internally*? Pin
Salil Khedkar25-Aug-04 20:45
Salil Khedkar25-Aug-04 20:45 
QuestionAre there dynamic array librarys available in C#? Pin
gotton24-Aug-04 20:10
gotton24-Aug-04 20:10 
AnswerRe: Are there dynamic array librarys available in C#? Pin
leppie24-Aug-04 21:04
leppie24-Aug-04 21:04 
AnswerRe: Are there dynamic array librarys available in C#? Pin
Norman-Timo25-Aug-04 3:21
Norman-Timo25-Aug-04 3:21 
GeneralDrawing Pin
Member 1697724-Aug-04 18:29
Member 1697724-Aug-04 18:29 
GeneralRe: Drawing Pin
sreejith ss nair24-Aug-04 18:56
sreejith ss nair24-Aug-04 18:56 
QuestionFirst time using Windows Forms -- Components not appearing? Pin
Waverian24-Aug-04 17:23
Waverian24-Aug-04 17:23 
Firstly, just to say.. I've got some experience in C#, mainly scripting components for a MMORPG Emu, so I understand a decent variety of concepts in the language.

However recently I decided to.. ahem.. expand my horizons and branch into outside applications in C#, namely Windows Forms in this case.

I've sort of hit a road block early on with generating the components of my form.

using System;<br />
using System.Windows.Forms;<br />
using System.Drawing;<br />
<br />
namespace Waverian.ScriptGenerator<br />
{<br />
	public class ScriptGenForm : Form<br />
	{<br />
		public ScriptGenForm()<br />
		{<br />
			InitializeComponent();<br />
			<br />
			Button b1 = new Button();<br />
			b1.Height = 10;<br />
			b1.Width = 25;<br />
			b1.Text = "Text";<br />
			b1.Location = new Point( 15, 15 );<br />
		}<br />
		<br />
		[STAThread]<br />
		public static void Main(string[] args)<br />
		{<br />
			Application.Run(new ScriptGenForm());<br />
		}<br />
		<br />
		#region Windows Forms Designer generated code<br />
		private void InitializeComponent()<br />
		{<br />
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
			this.ClientSize = new System.Drawing.Size(292, 266);<br />
			this.Text = "Waverian's Script Generator";<br />
			this.Name = "ScriptGenForm";<br />
		}<br />
		#endregion<br />
	}<br />
}


The problem is, even though I've created a button b1, and thought I'd placed it correctly ( in defining location ), when I run the program it only displays the form itself, and not the button.

I've also tried adding components within the InitializeComponent() method, but that also did not produce the button. -.-

Could anybody enlighten me in to how ( or where. I'd assume it was in the constructor ) I'd place a component such as a button?

Cheers,
Waverian.
AnswerRe: First time using Windows Forms -- Components not appearing? Pin
sreejith ss nair24-Aug-04 18:53
sreejith ss nair24-Aug-04 18:53 
QuestionSingleton ? Pin
Christian Graus24-Aug-04 16:06
protectorChristian Graus24-Aug-04 16:06 
AnswerRe: Singleton ? Pin
Heath Stewart24-Aug-04 16:11
protectorHeath Stewart24-Aug-04 16:11 
QuestionHashtable error: &quot;Object reference not set to an instance of ans object.&quot;! ??? Pin
gman4424-Aug-04 15:04
gman4424-Aug-04 15:04 
AnswerRe: Hashtable error: &quot;Object reference not set to an instance of ans object.&quot;! ??? Pin
Charlie Williams24-Aug-04 15:33
Charlie Williams24-Aug-04 15:33 
GeneralRe: Hashtable error: &quot;Object reference not set to an instance of ans object.&quot;! ??? Pin
Heath Stewart24-Aug-04 15:53
protectorHeath Stewart24-Aug-04 15:53 
GeneralRe: Hashtable error: &quot;Object reference not set to an instance of ans object.&quot;! ??? Pin
Charlie Williams24-Aug-04 16:35
Charlie Williams24-Aug-04 16:35 
AnswerRe: Hashtable error: &quot;Object reference not set to an instance of ans object.&quot;! ??? Pin
Heath Stewart24-Aug-04 15:51
protectorHeath Stewart24-Aug-04 15:51 
AnswerRe: Hashtable error: "Object reference not set to an instance of ans object."! ??? Pin
Jay Shankar24-Aug-04 16:09
Jay Shankar24-Aug-04 16:09 
GeneralC# CreateGraphics() Pin
Moon Boy24-Aug-04 13:01
Moon Boy24-Aug-04 13:01 
GeneralRe: C# CreateGraphics() Pin
Charlie Williams24-Aug-04 13:33
Charlie Williams24-Aug-04 13:33 
GeneralRe: C# CreateGraphics() Pin
Jay Shankar24-Aug-04 15:19
Jay Shankar24-Aug-04 15:19 
GeneralRe: C# CreateGraphics() Pin
Moon Boy24-Aug-04 16:52
Moon Boy24-Aug-04 16:52 
GeneralRe: C# CreateGraphics() Pin
leppie24-Aug-04 19:57
leppie24-Aug-04 19:57 
GeneralRe: C# CreateGraphics() Pin
Jay Shankar24-Aug-04 21:30
Jay Shankar24-Aug-04 21:30 
GeneralC# UserControl Pin
markjuggles24-Aug-04 11:20
markjuggles24-Aug-04 11:20 
GeneralRe: C# UserControl Pin
Nick Parker24-Aug-04 11:32
protectorNick Parker24-Aug-04 11:32 

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.