473,408 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Dynamic Contorls & Classes

Hiya All,

I'm coding in C#, & making a windows application. I am trying to figure out
how to put my dynamic control code in a seperate class (say ie
ButtonClass.cs) so that I can re-use the code with in multiple forms
(ie.frmOne, frmTwo). Being a newbie, I'm not sure if I should try my hand at
Interface class or what to do here.

Could anyone out there please give me advice on how to do this, what is
needed and or better yet, a simple sample. Say adding dynamic button or
textbox to a form.

Thank you all in advance.

MikeY

Nov 13 '05 #1
2 3784
MikeY,

All you really have to do is call the Add method on the Controls
property that the form exposes. You would pass in the control that you want
to add to the form, and the control's Location and Size properties will
dictate the size and the location of the control on the form.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"MikeY" <mi*******@yahoo.ca> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...
Hiya All,

I'm coding in C#, & making a windows application. I am trying to figure out how to put my dynamic control code in a seperate class (say ie
ButtonClass.cs) so that I can re-use the code with in multiple forms
(ie.frmOne, frmTwo). Being a newbie, I'm not sure if I should try my hand at Interface class or what to do here.

Could anyone out there please give me advice on how to do this, what is
needed and or better yet, a simple sample. Say adding dynamic button or
textbox to a form.

Thank you all in advance.

MikeY

Nov 13 '05 #2
Thanks Nicholas. Much appreciated

MikeY

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:O4**************@TK2MSFTNGP11.phx.gbl...
MikeY,

All you really have to do is call the Add method on the Controls
property that the form exposes. You would pass in the control that you want to add to the form, and the control's Location and Size properties will
dictate the size and the location of the control on the form.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"MikeY" <mi*******@yahoo.ca> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...
Hiya All,

I'm coding in C#, & making a windows application. I am trying to figure out
how to put my dynamic control code in a seperate class (say ie
ButtonClass.cs) so that I can re-use the code with in multiple forms
(ie.frmOne, frmTwo). Being a newbie, I'm not sure if I should try my

hand at
Interface class or what to do here.

Could anyone out there please give me advice on how to do this, what is
needed and or better yet, a simple sample. Say adding dynamic button or
textbox to a form.

Thank you all in advance.

MikeY


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
1
by: npverni | last post by:
I have a fairly complex form that needs to load and maintain the state of several different dynamic user controls. Here is the workflow: 1) A series of editable user controls (each containing...
11
by: toton | last post by:
Hi, I have little confusion about static memory allocation & dynamic allocation for a cluss member. I have class like class Bar{ public: explicit Bar(){ cout<<"bar default"<<endl; }
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.