|
Hi everyone!
Please tell me how can i restrict only one child window in MDIParent?
Does Microsoft Word 2003 use MDI with only child window?
I have made child window and made it Maximize and Minimze button "false" and its window state "Maximized" but it doesn't give desired results. It shows Minimize and restore button in Main Menu bar.
Please tell me what to do ?
Thanks
|
|
|
|
|
Microsoft Word 2003 uses a different type of option called Multiple SDI. .NET 2 has this option available to it by deriving your form class from WindowsFormsApplicationBase. An example can be found here:
http://en.csharp-online.net/Application_Architecture_in_Windows_Forms_2.0%E2%80%94Multiple-SDI_Applications[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks.
I have used this in my application. I have made
"Multiple Single Document Interface" for the Main Form of my application.
But now that Main Form is an MDI Parent Form. If I open first instance of application that gives me option to create a new file under the "File Menu". Now I want that file to show only close button in Menu bar and take all the MDI parent client space.
Is that possible?
I have made my Main Form as MDI Parent. I used to create new file using file menu, but how i can emit minimize and restore button in the menu bar. I want to show only close option.
|
|
|
|
|
please tell me how one child can be shown if Parent Mdi has Main MEnu and Toolbar.
I create Mdi child it doesn't fills whole client area of MdiParent.
Also when i close the MdiParent icon bar of child takes space up on the MdiParent Main Menu for a while and form closes although i have disabled child control box.
|
|
|
|
|
Hi All,
I need to to dispose of some stuff in a class. But, the class derived from a class which also implements IDisposable.
The dispose method is not marked as virtual, I cannot override it.
How can I get my classes Dispose() called and then call Dispose() on it's base class?
Thanks
Jon
|
|
|
|
|
You need to have your derived class derive from IDisposable also and explictly implement the Dispose method, call the base dispose from there.
public class Foo : IDisposable<br />
{<br />
public Foo()<br />
{<br />
<br />
}<br />
<br />
public void Dispose()<br />
{<br />
}<br />
}<br />
<br />
public class Bar : Foo, IDisposable<br />
{<br />
public Bar()<br />
{<br />
<br />
}<br />
<br />
void IDisposable.Dispose()<br />
{<br />
base.Dispose();<br />
}<br />
}
only two letters away from being an asset
|
|
|
|
|
Try this:
namespace TestDisposable
{
public class DisposeClass : IDisposable
{
public DisposeClass()
{
}
#region IDisposable Members
public void Dispose()
{
Console.WriteLine("Called dispose in DisposeClass");
}
#endregion
}
public class Class2 : DisposeClass, IDisposable
{
public new void Dispose()
{
base.Dispose();
Console.WriteLine("Called dispose in Class2");
}
public void DoIt()
{
}
}
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks guys,
I thought i'd tryed that in the myriad things I tried, but evidentally not. I'll get back on it.
|
|
|
|
|
Your class also needs to derive from IDisposable and call base.Dispose() in your Dispose method.
You can also look here for more information:
http://www.codeproject.com/useritems/idisposable.asp[^]
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi,
Does anyone know how to export my code to visio so it will be an UML diagram?
Thanks in advance!
|
|
|
|
|
From project menu, you should be having an option to Reverse Engineer to Visio right?
|
|
|
|
|
Hi Vasudevan Deepak Kumar,
Thanks for your reply!
Strange, i don't see that link. I got vs 2005.
I'll check it out, i needed the "key word" to do this.
Thanks!
|
|
|
|
|
If you've got VS2005 why do you need to reverse engineer to Visio? You can create a class diagram in Visual Studio directly.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello,
How many instances of x do I have in the following example?
class MyBaseClass<br />
{<br />
protected static int x;<br />
}<br />
<br />
class MyDerived1 : MyBaseClass { }<br />
class MyDerived2 : MyBaseClass { }<br />
<br />
MyDerivedClass1 c1;<br />
MyDerivedClass1 c2;<br />
<br />
MyDerivedClass2 c3;<br />
MyDerivedClass2 c4;
I would say for sure that c1 and c2 share the same x .
But what about c3 and c4 ?
Do they share c1 's and c2 's x ?
Is a new static x allocated for them?
Thanks in advance,
Shy.
|
|
|
|
|
Hi, i would say that x has every where the same value.
Because the static-Element is a type, outside of all instances.
Each instance has access to this variable and can manipulate it.
And your derived classes have derived this permission to this element.
So i think all instances can alternate this static variable.
I never use/try it before, but it seems logic for me.
|
|
|
|
|
Why not try and code it up and see what you get when running it? You've done the hard work already so testing it should be easy.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Just did...
It appears that only one instance of X is allocated.
|
|
|
|
|
Which is consistent with the behaviour of static.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
How can I set the autoscroll property of an MDI from without losing its MDIcontainer property.
When I set the AutoScroll Property to "True", IsMdiContainer Property is automatically set to "False". How can I make both the property to true simultaneously.
If anyone has any idea, please reply me soon.
Thanks
|
|
|
|
|
I've tried it in VS2005, if you set IsMdiContainer = true, then you can see that AutoScroll will be set to false, but if I try to put the window outside the border, scrollbar will be shown. That means, AutoScroll is always true (don't see Properties Window... ) if you set IsMdiContainer=true.
|
|
|
|
|
But the problem is that Whatever the child window size the scroll bar is showing
for a fixed size. I want this autoscroll property for zooming in and out the images in a child window.
|
|
|
|
|
Then the autoscroll should be on the child form.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All,
I am new to C# and OOP. I refered a article about Single instance child for in MDIhttp://www.codeproject.com/csharp/single_instance.asp?df=100&forumid=51798&select=1394073#xx1394073xx[^])
I tried to write a sub program to stop that code duplication as follows
private void frmLoad(Form frmNew)<br />
{<br />
Form[] charr = this.MdiChildren;<br />
if (charr.Length == 0)
{<br />
frmNew sus = new frmNew();<br />
sus.MdiParent = this;<br />
sus.StartPosition = FormStartPosition.Manual;<br />
sus.Location = new Point(0, 0);<br />
sus.Show();<br />
}<br />
else
{<br />
int count = 0;<br />
foreach (Form chform in charr)<br />
{<br />
if (chform.Name == "frmNew")
{<br />
chform.Activate();<br />
count = 0;<br />
break;
}<br />
else<br />
count++;<br />
}<br />
if (count > 0)<br />
{<br />
frmNew sus = new frmNew();<br />
sus.MdiParent = this;<br />
sus.StartPosition = FormStartPosition.Manual;<br />
sus.Location = new Point(0, 0);<br />
sus.Show();<br />
}<br />
<br />
}<br />
}
I want to pass a form name as a argument. what is wrong with this?
Please can anybody help me?
mWith
|
|
|
|
|
Just create a member variable for frmNew:
private Form2 frmNew = null;
private void CreateFrmNew()
{
if (frmNew == null)
{
frmNew = new Form2();
frmNew.MdiParent = this;
frmNew.StartPosition = FormStartPosition.Manual;
frmNew.Location = new Point(0, 0);
}
frmNew.Show();
}
Call CreateFrmNew, it will create frmNew if not exists, otherwise frmNew will be shown.
|
|
|
|
|
Hi im writing a TCP Server/Client application and i have a general Question.
When i have a TcpServer that will communicate with many clients.
Shall i communicate with the clients over one port
OR
Shall i communcate with the clients over one several port for each client ?
OR
Is it so, that the .NET-Framework handle this for itself and its no problem
to communicate with many client over one port ?
|
|
|
|