|
I just would like to know if this is possible and is there any example to do it.
I have multiple form (MDI) which have a method that i would like to call from the parent MDI.
So I would like to click on a button in the parent MDI and the code will call the a specific method that is in the activeChild.
Does anyone have any ideal?
|
|
|
|
|
Hi all,
I am having problems with web services. I've read tons of articles and im still stuck!
I have Visual Studio.NET (VS) installed and Personal Web Server (PWS) and have created a c# web service and built it. However when I attempt to look at the .asmx file I do not get the *user friendly* description of the web service and option to invoke it - Instead I get the raw text from the .asmx file!
I'm sure this is something simple but what?
Thanks in advance!
Dave
|
|
|
|
|
Hi Dave,
I think your problem is that you want to be running IIS on your web server with your .asmx web service file. As stated in VS.NET help if you bypass IIS and ASP.NET "you will just see the plain text in the .asmx file" when viewing a .asmx file in a browser/VS.NET.
Hope this helps,
Paul
Paul Hutchinson
IT Consultant/Analyst Programmer
|
|
|
|
|
Hi all,
I'm writing a notepad-like program using C#
I want to use the Popup event of the Edit menu to disable the paste menu command when the clipboard does not contain any text.
can any one help?
also how to get the Ascii code for a character and vise-vesa?
|
|
|
|
|
You would need to add this code to disable a menu item:
MenuItem.Enabled = false;
And check out the Clipboard subtopics in the index of the .NET Framework SDK Documentation for clipboard info.
hspc wrote:
also how to get the Ascii code for a character and vise-vesa?
I also would like to know this
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
if your text is stored in single-byte strings you can convert a character to a byte and the value will be the ASCII code. By default strings are stored as Unicode and the char type is two bytes instead of one to reflect this.
You can convert a string to ASCII bytes by using byte [] bytes = System.Text.ASCIIEncoding.ASCII.GetBytes(myString);
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
Thank you!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
thanx all for assisstance
|
|
|
|
|
Hi,
I've been looking over the Collection classes available through the .NET framework and it seems that LinkedList hasn't been provided (Unless it is in some other namespace which I haven't checked - If so could you point it out - Thanks!).
Any ideas as to why they haven't included it in the Framework? It is a very useful data structure and has many uses just as ArrayList does.
Actually... it would be a good article to compare the Collections framework that .NET and Java provide. Cause I know that the Java Collections framework is heavily based on inheritance and abstract classes. It would be an interesting article to see the differences between them.
As a side question - Are the .NET Enumerators the same as the Java Iterators?
Thanks very much.
Mohnish
|
|
|
|
|
mohn3310 wrote:
Any ideas as to why they haven't included it in the Framework?
Good question, it does seem odd that it isn't there. You could easily create your own version of it though. If you don't know how to create a linked list there are many places on the web that will give you code for doing it
mohn3310 wrote:
Are the .NET Enumerators the same as the Java Iterators?
Enumerators in .NET are used to go through a collection an element at a time.
IEnumerator ie = myCollection.GetEnumerator();
while(ie.MoveNext) {
System.Console.WriteLine("object: " + ie.Current.ToString());
} or if you are using C# you can use foreach
foreach(object foo in myCollection) {
System.Console.WriteLine("object: " + foo.ToString();
} Simple, eh?
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
Thanks James!
Yes, LinkedLists are relatively simple to create and there are lots of examples on the web, but I was just wondering why they didn't include it since it's such a generic data structure.
Normally we would create wrappers to ArrayLists or LinkedLists to make them typesafe (using our own classes) rather than using Objects.
Yeah, enumerators do seem to act like iterators in java.
Cool... thnx again
Mohnish
|
|
|
|
|
mohn3310 wrote:
Normally we would create wrappers to ArrayLists or LinkedLists to make them typesafe (using our own classes) rather than using Objects.
Microsoft has made that part easier on us developers
Collection Generator for .NET 1.0 creates a collection based on ArrayLists to store objects of a specified type.
Until .NET supports generics this is the best solution to it.
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
I learned in some articles here describing using DHTML new feature in MFC7.
Will it be possible to use such a control in windows forms (not web form)? I hope it will ease the maintainment of the user interface, and maybe provide a way that user can custom his favourite dialog.
and another question is there in any corner of visual studio .net that two columns list control which studio used to edit properties provided? does microsoft kind enough to provide us a such powerful control? I wanna use it to set some object's properties in my form.
|
|
|
|
|
Chen, Fu wrote:
Will it be possible to use such a control in windows forms (not web form)?
You'll have to look at using hosting the web browser control on your form to use anything with DHTML. I'm not sure if it supports DHTML by default or if you have to do some coding to add that functionality.
Chen, Fu wrote:
and another question is there in any corner of visual studio .net that two columns list control which studio used to edit properties provided? does microsoft kind enough to provide us a such powerful control? I wanna use it to set some object's properties in my form.
Look for the PropertyGrid, right click on the toolbox and choose "customize toolbox" then goto the .NET Framework Controls tab, you should find the PropertyGrid there.
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
yeah, i find the PropertyGrid now! it's very helpful to change the control's property at runtime.
Thanks!
|
|
|
|
|
C#'s compiled result is a exe in CLR code.
it said required JIT run.
does it mean compile to native code once software is deployed?
or compile each time we used it?
will it be a burden when we develop a fairly big application?
|
|
|
|
|
The JIT compiles each method as it is executed for the first time while running. This is why startup time for a .NET program is so long. You can get rid of the JIT by performing an install time JIT, ngen <assembly> will pre-JIT the code.
There is no guarantee the code won't be JITted again later. However I think it is a safe bet that won't happen since a reason to JIT is when the underlying IL has changed or it has been requested (usually for the above reason).
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
Thank you, very helpful.
well, I find it now -- ngen!
|
|
|
|
|
Hi,
If we use Properties in our Class we would need one "local" variable to actually hold the value and one to actually be accessed from the outside...
private string name; // local
public string Name // access outside
{
get
{
return name;
}
set
{
name = value;
}
}
So basically my question is... are there TWO variables or only ONE... Is the public one just for asthetic reasons? If there are two it would be wasting space everytime we use a Property wouldn't it?
Also the "value" parameter - is that always assumed in Properties, cause I don't see any explicit mention of it anywhere?
Thanks.
Mohnish
|
|
|
|
|
I think ONE. ( may be this approach can help us)
As we know , this the way of accessing member variables( state of the class) through methods(get,set) without breaking the client code.
Often memeber variables (State) need to be computed.(ex: get and set to/from DB),then this way of accessing will be useful.
I think this the trade-off.(If we really wasting space)
Check your MSIL using ILDASM.exe( NET FWk/SDK/ bin).
in your example, NAME is property and name is member variable.
Next,
value is implicit parameter for "set" method
CLR reads your program as
set(value)
{
membervariable = value;
}
Thanks,
Anand.
|
|
|
|
|
In your example there is only ONE real member variable: name. Indeed, "Name" just exists just for aesthetic reasons.
Your example doesn't yet show the advantages of using Properties. These arise if you add e.g. bounds-checking code to your get and/or set accessors.
Sito Dekker
|
|
|
|
|
I was wondering if someone can give me a sample code for Upload/Download on FTP.
Is it possible using only TcpClient,NetworkStream,StreamReader or I have to use Socket absolutely ?
Thanks for your help
|
|
|
|
|
I found a sample code here:
http://home.wi.rr.com/skulkarni/FTP/FTPIndex.html
rgrds
Martin
|
|
|
|
|
When a cell inside a datagrid has the focus and the up or down arrow key is pressed the focus moves to the previous or next cell. How can I intercept this event and execute code based on the pressing of the up or down arrow key? The OnKeyUp, OnKeyPress and OnKeyDown are not working as normal in the datagrid. Thanks for your help.
Kyle
|
|
|
|
|
kyledunn wrote:
How can I intercept this event and execute code based on the pressing of the up or down arrow key? The OnKeyUp, OnKeyPress and OnKeyDown are not working as normal in the datagrid.
You need to override the IsInputKey method to tell the datagrid that those keys are to be sent to OnKey* rather than treated specially by the underlying code.
You can only do this if you are creating a class that inherits from DataGrid though.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|