|
Have you considered calling the method that handles the Click event?
I will use Google before asking dumb questions
|
|
|
|
|
It's an "event delegate", you cannot call it in your code. You can only use it at the left side of + or += operator.
You know, I download an html document, it's written by other people. In the page there was a button. I want to emulate a "click" of the button in my program.
I googled but no useful result.
|
|
|
|
|
is it possible to return a bool on the Dictionary.ContainsKey where the key is a regex pattern?
for example if i have a hashtable (or a dictionary) of regex patterns as keys, and i want to know if the string the user entered matches to the key, do i have to search key by key with a "foreach" or does any one know a solution for searching faster.
Thanks.
|
|
|
|
|
never.reply wrote: do i have to search key by key with a "foreach"
Yes
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Instead of wasting time on typing so much. You could have tried it with some regex example. That would have taken less time.
Anyways it is possible
Nana
|
|
|
|
|
"Anyways it is possible"
How is that possible
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(@"^L(\w{1})$", "0");
Why does dic.ContainsKey("LA") return false when it matches regex?
|
|
|
|
|
First thing I think the interpretation is wrong.
You are not using a Regex as a key of the dictionary.
Its a string object.
Then how can you search the contains key on regex?
Nana
|
|
|
|
|
You have to iterate over the dictionary I'm afraid. You are trying to shoehorn functionality into an item that is only a key, and has no purpose other than to identify a particular item in the collection for quick retrieval.
|
|
|
|
|
The biggest problem with that is that the value passed in may match more than one key's pattern even though the patterns are unique. You'll need to decide what to do in those cases. Iteration will be required.
|
|
|
|
|
hi guys
what is this operator " {0} "?
such as:
Console.WriteLine("Property Value: {0}", ///);
saeed ghanavat
|
|
|
|
|
saeed470 wrote: what is this operator " {0} "?
This can be replaced by the object specified.
string str = "test";
int a = 10;
Console.WriteLine("{0}{1}",str,a) If you are using this, you can avoid casting the object to string explicitly.
|
|
|
|
|
i have menu in my application and i need to create general form object that can be converted to type of the active form to execute some void in active form so i need to convert (frm) which is form to customized form like employeeform and so on
thanks
md_refay
|
|
|
|
|
What is the question?
Nana
|
|
|
|
|
Hi,
I was doing some experiments with C# 3.5 and I got the following code which is very tough to digest for me. Could anyone help me to understand this ?
class MySimpleClass
{
private string _Property1 = string.Empty;
private string _Property2 = string.Empty;
public string Property1
{
get { return _Property1; }
set { _Property1 = value; }
}
public string Property2
{
get { return _Property2; }
set { _Property2 = value; }
}
} Following is the code where above class instance are kept in a List<>
List<MySimpleClass> objList = new List<MySimpleClass>{
new MySimpleClass{Property1="Hello",Property2="Hello1"}
}; How such type of invoking is possible ? I checked with the overloaded constructors for List class. But I couldn't find any matching methods there. I tried removing the instance creating of MySimpleclass . Then it shows error no overload method matches the parameter. From this I guess when we specify in the above format, automatically it is calling the Add() method specified in the List . How this happening, since no overloaded constructor takes MySimpleclass as parameter ?
Any ideas ?
|
|
|
|
|
Maybe this blog will help. (at the object initializer part)
Click Here^
|
|
|
|
|
Thanks for the link. That explains the syntax well. But still I am not getting how the call is going to Add() method ? Let me try with creating a custom collection and adding items. Thanks again
|
|
|
|
|
Yes I found it. If any class which implements IList, and initialize like the above sample, it will call Add() method by default.
|
|
|
|
|
hi,
i am working on 2.0 winforms.
any plz tell me how to show an icon or image in ListView ColumnHeader.
thanks
Ramana
|
|
|
|
|
Check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I have created a MDI form and is has menus like file edit etc. On file menu I have login sub menu. I initially disable all the menus except file. With click on login sub menu login form open and user can put user name and passowrd. The question is if that password is correct I need to enable the menus. How is it possible ? please help me.
keyto
|
|
|
|
|
This[^] article might help you. It does something very similar, so should serve as a good start.
|
|
|
|
|
hi
how can i zip and unzip file in C# code ?
thank's
|
|
|
|
|
depend onthe zipping/unzipping tool.
use System.Diagnostics.Process class,
through Process class execute the zipping executable with command line parameters.
convert zipped/unzipped files to the stream & write into the hard disk?
go it?
Ramana
|
|
|
|
|
Hello,
You could use "SharpZibLib", which is a part of the free "SharpDevelop" project!
Can be downloaded (with examples) here![^]
All the best,
Martin
|
|
|
|
|
Hi.....
By using GZipStream class you can compress and decompress the file.....
GZipStream Example Link[^]
Regards,
Sandeep Kumar.V
|
|
|
|