Click here to Skip to main content
15,908,843 members
Home / Discussions / C#
   

C#

 
GeneralRe: Datetimepicker culture Pin
tornn30928-Apr-05 19:18
tornn30928-Apr-05 19:18 
GeneralRe: Datetimepicker culture Pin
mav.northwind28-Apr-05 20:08
mav.northwind28-Apr-05 20:08 
GeneralPop-Ups Pin
Sergio Luix27-Apr-05 21:14
Sergio Luix27-Apr-05 21:14 
GeneralRe: Pop-Ups Pin
mav.northwind28-Apr-05 0:00
mav.northwind28-Apr-05 0:00 
Generalinstrumenting an application in .NET Pin
G_Zola27-Apr-05 20:49
G_Zola27-Apr-05 20:49 
GeneralRe: instrumenting an application in .NET Pin
Marc Clifton28-Apr-05 6:04
mvaMarc Clifton28-Apr-05 6:04 
GeneralRe: instrumenting an application in .NET Pin
G_Zola28-Apr-05 14:42
G_Zola28-Apr-05 14:42 
GeneralClass Library Help Plz Pin
mikesinfo27-Apr-05 17:46
mikesinfo27-Apr-05 17:46 
Hi everyone,

I am trying to learn how to use dynamic controls with/by calling a class library (ButtonTest.cs) that is on a separte *.cs, that contains the properties that will set them from my main form (frmMain.cs). I am using windows forms, C#. The two codes for the two forms are as follows:

>>frmMain.cs<< Calling form

using System;
using System.Drawing;
using System.Collections;
using System.Component.Model;
using System.Windows.Forms;
using System.Data;

namespace Test
{
public frmMain()
{
InitializeComponent( );
ButtonProperties myTest = new ButtonProperties();
myTest.AddControl(new Button( ), new Point(5,5), new Size(75,75), "ButtonName", 0, "");
}
}

>>ButtonTest.cs<<

using System;

namespace Test
{
class ButtonProperties
{
public void AddControl(Control aControl, Point Location, Size Size, String strText, int TabIndex, string strName);
{
aControl.Location = Location;
aControl..Size = Size;
aControl.Text = strText;
aControl.TabIndex = TabIndex;
aControl.Name = strName;
this.Controls.Add(aControl);
}
}
}

Now the problem is that the "this.Controls.Add(aContol);" does not get returned and the button is not displayed. The error is as follows: "Test.ButtonProperties" does not contain a definition for Controls. Hmmm

Any and all help is truly appreciated.

MikeY


I can't be this stupid
GeneralRe: Class Library Help Plz Pin
rudy.net27-Apr-05 19:09
rudy.net27-Apr-05 19:09 
GeneralRe: Class Library Help Plz Pin
mav.northwind27-Apr-05 20:11
mav.northwind27-Apr-05 20:11 
QuestionIs there a way to resize a textbox to fit it's contents?? Pin
OnlyTaz27-Apr-05 17:34
OnlyTaz27-Apr-05 17:34 
AnswerRe: Is there a way to resize a textbox to fit it's contents?? Pin
mav.northwind27-Apr-05 20:15
mav.northwind27-Apr-05 20:15 
GeneralRe: Is there a way to resize a textbox to fit it's contents?? Pin
OnlyTaz28-Apr-05 10:50
OnlyTaz28-Apr-05 10:50 
QuestionWhy can't I change Row during Insert?? Pin
Besinci27-Apr-05 14:09
Besinci27-Apr-05 14:09 
AnswerRe: Why can't I change Row during Insert?? Pin
Marc Clifton28-Apr-05 6:09
mvaMarc Clifton28-Apr-05 6:09 
GeneralRe: Why can't I change Row during Insert?? Pin
Besinci28-Apr-05 11:53
Besinci28-Apr-05 11:53 
GeneralDeployment Project: Getting Property Value into DWORD Registry Entry Pin
mwhouser27-Apr-05 13:45
mwhouser27-Apr-05 13:45 
Questionstream? how does it work? Pin
Snowjim27-Apr-05 12:26
Snowjim27-Apr-05 12:26 
AnswerRe: stream? how does it work? Pin
Dave Kreskowiak27-Apr-05 16:28
mveDave Kreskowiak27-Apr-05 16:28 
GeneralRe: stream? how does it work? Pin
Snowjim27-Apr-05 22:44
Snowjim27-Apr-05 22:44 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 3:35
turbochimp28-Apr-05 3:35 
GeneralRe: stream? how does it work? Pin
Snowjim28-Apr-05 6:47
Snowjim28-Apr-05 6:47 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 7:22
turbochimp28-Apr-05 7:22 
GeneralRe: stream? how does it work? Pin
Snowjim28-Apr-05 7:31
Snowjim28-Apr-05 7:31 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 7:46
turbochimp28-Apr-05 7:46 

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.