|
Did you run your question through an automatic translator or something? I can hardly understand a thing.
Try again...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
apologize for my poor english first,i have writen the question again ,could you understand what i want to say now
|
|
|
|
|
It would be better if you posted the actual code that you try to use. It's hard to tell which errors in the code comes from mistakes typing it in and which errors it is that cause the actual problem.
You can do like this to get access to controls of a specific type:
private void findcontrol(Control.ControlCollection controls) {
foreach (Control ctrl in controls) {
WhateverControlYouWant whatEver = ctrl as WhateverControlYouWant;
if (whatEver != null) {
}
findcontrol(ctrl.Controls);
}
}
Here's a generic version of the method, taking a type and a delegate for whatever to do with the control:
private void ProcessControls<T>(Control.ControlCollection controls, Action<T> action) {
foreach (Control ctrl in controls) {
T t = ctrl as T;
if (t != null) {
action(t);
}
ProcessControls<T>(ctrl.Controls, action);
}
}
Usage example:
ProcessControls<Button>(this, delegate(Button b){ b.Enabled = false; });
Despite everything, the person most likely to be fooling you next is yourself.
modified on Monday, September 1, 2008 12:45 PM
|
|
|
|
|
Thanks a lot.I could understand the first example and i will improve my code.And i will try the second example since i haven`t used such kind of type(ProcessControls<t>).
But what truely trouble me now is the special type i want just could find on the sub-class.In my case,the XXTableAdapter was defind when i added a Dataset in the project.But when i designing the father class i could not used this type.
modified on Monday, September 1, 2008 10:06 PM
|
|
|
|
|
from gmail to aol, without change in any of message data....
|
|
|
|
|
are you trying to do that in a C# program??
if so then id imagine youd have to use gmail's and aol's API's if they even have any...
|
|
|
|
|
If we will use imap.... its possible or not? I gone through RFC3501(IMAP), also overviewed RFC2822(Internet Message format). But i am not getting any clue. I build connection and mail fetch program. but what next for tranfer?
|
|
|
|
|
Hello
Do someone know how to get the device id of a pocket PC?
Best regards
dghdfghdfghdfghdgh
|
|
|
|
|
Please check this link
[^]
Cheers!!
Brij
|
|
|
|
|
how do i deploy it to my pocket
dghdfghdfghdfghdgh
|
|
|
|
|
I want to get a parameter(for example "Path of Data") from user in commandline.
How can I do it?
Hello Friends
|
|
|
|
|
Your Main method accepts a string array as a parameter. This contains what the user (or a shortcut) passed from the command line.
Cheers,
Vıkram.
"if abusing me makes you a credible then i better give u the chance which didnt get in real" - Adnan Siddiqi.
|
|
|
|
|
Please find below:
public static void Main (string[] args)
{
if (args.Length > 0)
{
System.Console.WriteLine (args[0]);
try
{
long number = long.Parse (args[0]);
System.Console.WriteLine ("Number = " + number);
}
catch (System.FormatException e)
{
System.Console.WriteLine ("FormatException" + e);
}
return;
}
System.Console.WriteLine ("Please enter a number");
}
Cheers!!
Brij
|
|
|
|
|
There's this cunning command called GetCommandLineArgs in the Environment class. This should help.
|
|
|
|
|
|
I wonder what exactly you want. But for getting the controls on a page you can have a loop like this
foreach (Controls c in this.Controls)
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I have seen some strings formatted like @"Hello World!", or something like that in code i have downloaded on the internet, and i was really wondering what that '@' symbol does. What's the difference between "Hello World!" and @"Hello World!"? Just curious.
void Play() { try { throw Ball(); } catch (Glove) { } finally { Play(); } }
"Failure is only the opportunity to begin again, this time more wisely."
"Don't ask for a light load, but rather ask for a strong back."
|
|
|
|
|
In the case of @"Hello World!" I don't believe it does anything. However
in a directory string
@"C:\Program Files\Common Files"
you don't have to escape the "\" like you would with out it.
"C:\\Program Files\\Common Files"
|
|
|
|
|
|
Ok, thanks. Live and learn.
void Play() { try { throw Ball(); } catch (Glove) { } finally { Play(); } }
"Failure is only the opportunity to begin again, this time more wisely."
"Don't ask for a light load, but rather ask for a strong back."
|
|
|
|
|
I use it a lot when I want large strings, like pieces of xml, to be readable in code.
with @ you can write something like this:
string xml = @"
<xml>
<test>
<value>1</value>
<value>2</value>
</test>
</xml>"
instead of:
string xml = "<xml><test><value>1</value><value>2</value></test></xml>"
Dawn is nature's way of telling you to go to bed.
|
|
|
|
|
Hi,
Can anyone guide me on how to get info on the key(s) pressed?!
TROJAN LIKE LOL
I can disable numbers or chars to being pressed in order to do some validations in c#, but that i can´t do.
Just give me a link if you know something about it
Thanks
nelsonpaixao@yahoo.com.br
|
|
|
|
|
|
i smell a key logger
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
yes yes yes
nelsonpaixao@yahoo.com.br
|
|
|
|