Click here to Skip to main content
15,887,911 members
Home / Discussions / C#
   

C#

 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
eggie524-Feb-03 4:08
eggie524-Feb-03 4:08 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
John Karbin24-Feb-03 4:29
John Karbin24-Feb-03 4:29 
Generalencrypting question Pin
jtmtv1822-Feb-03 13:29
jtmtv1822-Feb-03 13:29 
GeneralRe: encrypting question Pin
Furty22-Feb-03 17:57
Furty22-Feb-03 17:57 
GeneralRe: encrypting question Pin
jtmtv1822-Feb-03 19:04
jtmtv1822-Feb-03 19:04 
QuestionFitting a form in a control? Pin
Arun Bhalla22-Feb-03 11:42
Arun Bhalla22-Feb-03 11:42 
AnswerRe: Fitting a form in a control? Pin
leppie22-Feb-03 12:19
leppie22-Feb-03 12:19 
GeneralRe: Fitting a form in a control? Pin
James T. Johnson22-Feb-03 17:07
James T. Johnson22-Feb-03 17:07 
There are at least two ways to go about it, the first is the best way if you can modify the design which you have given above.

The second is what you'll have to do if you have no choice but to leave it as a Form. You won't get any design time support for it either, but something is better than nothing Wink | ;)

Since the Form class inherits ultimately from the Control class it is possible for a Form to be added as a child control.

To do this, first create an instance of the Form (MyForm mf = new MyForm()). Now set any properties you want on it, especially the Location, and Size properties. Now set the TopLevel property of the form to false (mf.TopLevel = false). You may or may not see this property in the IntelliSense pop-up, don't worry it is there Smile | :)

Now add the form to the Controls collection, Controls.Add( mf );. Lastly you need to make the form visible, mf.Visible = true.

All together now:

MyForm mf = new MyForm();
mf.Location = new Point( 8, 8 );
mf.Size = new Size( 150, 300 );
 
Controls.Add( mf );
mf.Visible = true; // mf.Show() *should* also work


James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

QuestionIs it me or does poeple have less problems with .NET on weekends? Pin
leppie22-Feb-03 11:23
leppie22-Feb-03 11:23 
Questionhow can I Change Type "String" to "char *" within C#? Pin
c.jack22-Feb-03 0:41
c.jack22-Feb-03 0:41 
AnswerRe: how can I Change Type "String" to "char *" within C#? Pin
leppie22-Feb-03 0:45
leppie22-Feb-03 0:45 
AnswerThere are several ways: you can use the unsafe keyword and the Marshal class in the System.Runtime.Interop namespace. But if you are calling an external function, you can use the MarshalAs, it would be a more efficient way. It depends on what you are Pin
Daniel Turini22-Feb-03 0:57
Daniel Turini22-Feb-03 0:57 
GeneralHence my vague reply Pin
leppie22-Feb-03 1:02
leppie22-Feb-03 1:02 
AnswerRe: how can I Change Type "String" to "char *" within C#? Pin
Stephane Rodriguez.22-Feb-03 1:50
Stephane Rodriguez.22-Feb-03 1:50 
GeneralRe: how can I Change Type "String" to "char *" within C#? Pin
c.jack23-Feb-03 15:14
c.jack23-Feb-03 15:14 
GeneralAccessing varibles across forms. Pin
draco_iii21-Feb-03 23:23
draco_iii21-Feb-03 23:23 
GeneralRe: Accessing varibles across forms. Pin
leppie21-Feb-03 23:44
leppie21-Feb-03 23:44 
GeneralRe: Accessing varibles across forms. Pin
draco_iii22-Feb-03 23:46
draco_iii22-Feb-03 23:46 
GeneralRe: Accessing varibles across forms. Pin
leppie23-Feb-03 0:09
leppie23-Feb-03 0:09 
GeneralRe: Accessing varibles across forms. Pin
draco_iii23-Feb-03 14:53
draco_iii23-Feb-03 14:53 
GeneralRe: Accessing varibles across forms. Pin
Stephane Rodriguez.21-Feb-03 23:57
Stephane Rodriguez.21-Feb-03 23:57 
GeneralRe: Accessing varibles across forms. Pin
draco_iii22-Feb-03 21:32
draco_iii22-Feb-03 21:32 
GeneralRe: Accessing varibles across forms. Pin
Omega50122-Feb-03 9:04
Omega50122-Feb-03 9:04 
GeneralI don't know if this is a well known bug or not, but... Pin
Member 9621-Feb-03 20:10
Member 9621-Feb-03 20:10 
GeneralEvents -- multithreaded & UI Pin
Arun Bhalla21-Feb-03 15:30
Arun Bhalla21-Feb-03 15: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.