|
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 ?
|
|
|
|
|
Everytime the client connected to your server, it will create a new TcpClient instance. That's why, you must use:
TcpClient tcpClient = tcpServer.AcceptTcpClient();
Just add this tcpClient to a list, and you can manage your connection to many clients using each tcpClient.
|
|
|
|
|
Yea i know but i use AcceptSocket().
But i thought that it can slow down the application when so many connections go over the same port =/
or did i though wrong ?
|
|
|
|
|
Im having a bit of difficulty doing a small simple Hangman game, im a novice at C# so any help would be handy thanks!
|
|
|
|
|
http://www.codeproject.com/netcf/hangman_dncf.asp
|
|
|
|
|
please explain your problem
|
|
|
|
|
What have you done so far?
|
|
|
|
|
Its something i was just assigned, so need a bit of guidance.
He's looking for arrays, 3 of them, like a easy/medium/hard version of the game. 6/8/10 lettered words.
|
|
|
|
|
Nobody here will do the work for you. But, they will be happy to help you along the way. You need to make an effort to create the project yourself. If/when you get stuck on a specific part, people here will definitely help you.
Since you haven't started the project, I suggest writing out the steps of the project (scope). You start with a high level overview of the project:
A Hangman program.
We select a random word from some source.
The user will guess letters.
We check if the letter exists in the word.
If the letter exists, display it in the correct place.
If the word is complete, the user wins.
If the letter does not exist, draw the next piece of the hangman.
If the hangman is complete, the user loses.
From there, get more specific about each of the steps until it looks like complete pseudo-code. From there, you can easily create the program based on the overview, which could possibly become the documentation of the project.
|
|
|
|
|
Thanks, ill post later on with a more detailed approach!
|
|
|
|
|
|
even if some one is in hurry or wants answer instantaneously,there is no harm.it is his need.if he has time why would he ask in a forum.he has every right to ask for an urgent response.nobody will ask urgent unless it is really so.there is no question of decreasing the willingness to answer.
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|