|
Right click and Double click functionality are disabled in the source for the check box so you'll heve to create your own.
This should get you started
public class MyCheck : CheckBox
{
[Browsable(true)]
public new event MouseEventHandler MouseDoubleClick;
public MyCheck()
{
SetStyle(ControlStyles.StandardClick |
ControlStyles.StandardDoubleClick, true);
}
protected override void OnMouseDoubleClick(MouseEventArgs e)
{
if (e.Button== MouseButtons.Right && MouseDoubleClick != null)
MouseDoubleClick(this, e);
}
}
You'll need to stop the right click from changing the CheckedState though and there's probably other functionality that maybe a little strange or broken so test it thoroughly.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Thats what i need,
thanks for fast reply
|
|
|
|
|
No problem, you're welcome.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi
When u start internet explorer on Windows mobile and u don't have connection yet then explorer automaticly starts connecting to internet. The same thing i would like to do in C#.
I want that my aplication looks if i am connected to internet and if i am not then it should connected it self automaticly.
Thank you for the answer.
|
|
|
|
|
Hey,
I'm a high-school student. and I have to do a final project in C# or in any other language. I was thinkin' of a particular project. and this project needs a lot of graphic working.
I want to work with pictures... I want to work with the pictures as an array of pixels so I can compare it with another picture.
and I want also ro crop it and resize it.
so if anyone knows any eBook that I can use it will be great.
and also if there is another language that I can use instade of C#
Please I need your help,
Programmer.Nick
|
|
|
|
|
Search the articles on here, there are MANY exmples.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I know there are many examples... but I don't know what examples to look for.
I need a paricular eBook or Book... that I can use which has the whole information that I need. Cause I want to start from the beginning.
Thanks
|
|
|
|
|
Have a look at Christian Graus' Image Processing for Dummies with C#[^] series. That should get you started
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
|
your welcome
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
please send me how to show list when i entered letter in textbox i am using asp.net 2.0 ajax the i want to lool like gmail
@nil
|
|
|
|
|
You should maybe ask in the ASP.NET forum but does this[^] help?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I am writing a windows application to upload file by using Backgroundworker and EventWaitHandle. But it doesn't get any respond after run the line 'handle.WaitOne();'. Can anyone help?
<br />
private void btnUpload_Click(object sender, EventArgs e)<br />
{<br />
BackgroundWorker worker = new BackgroundWorker();<br />
worker.DoWork += new DoWorkEventHandler(worker_DoWork);<br />
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);<br />
MessageBox.Show("FTP 1");<br />
worker.RunWorkerAsync();<br />
MessageBox.Show("FTP 2");<br />
handle.WaitOne();
MessageBox.Show("FTP 3");<br />
}<br />
static void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)<br />
{<br />
MessageBox.Show("FTP 4");<br />
handle.Set();<br />
}<br />
<br />
|
|
|
|
|
One of the nice things about BackgroundWorker is that RunWorkerCompleted is raised on the UI thread. In your example, you have blocked the UI thread with the call to handle.WaitOne() , so worker_RunWorkerCompleted can never run and signal your handle
Also, the point of BackgroundWorker is to avoid blocking the UI thread. Why are you blocking it?
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
First I must state I'm newish to C#. I am/was a decent Perl script kiddy.
I can not seem to locate good tutorials or code examples that help me to build a simple treeview. Some of the ones I have seen are pretty complex that I can't quite grasp it, the other easy ones are so abstract it teaches me nothing about implementation.
I will show what code I have then ask my question below it:
TreeNode parentNode = new TreeNode();
parentNode.Text = "Name";
parentNode.Tag = 1;
parentNode.ExpandAll();
treeView1.Nodes.Add(parentNode);
TreeNode childNode = new TreeNode();
childNode.Text = "Child";
childNode.Tag = 2;
parentNode.Nodes.Add(childNode);
This creates a very simplistic Parent called "Name" and a Child called "Child".
Questions:
1) This works for creating a single child, but can someone explain to me how I reference the parent specifically to add more children? To rephrase: If I have many Parents, how do I pick one of the parents to add more children?
2) What exactly is the .Tag used for?
3) How do I make a variable or object that would store one specific parent or child so that I could read/write data, or add add children too it?
4) Why is it so hard to find a tutorial or books that contain information about TreeView?
Hope this is appropriate for my first post here.
Thanks,
TriX
|
|
|
|
|
1a. You can keep a reference to the node(s) that you want to add to or
1b. Use the overload Nodes.Add(string key, string text) when adding a node. You can then use the Nodes.Find method to search your nodes based on the key. This returns a Treenode array as each key doesn't have to be unique - I'd recommend making sure each key is unique though then there will only ever be one element in the array.
2. The tag can be used for anything you like.
A common way is:
Imagine a tree of Employee names - the tag could contain an employee object with all their data but the node's text would probably only show their name (by using the ToString method on the employee object maybe?). This way, if you wanted to show all the employee's data, you'd have it handy without having to look it up again based on their name.
This can obviously become memory intensive so in the case where a lot of nodes are expected it might be better to use the tag to store the employee ID only, then when you need their data you can look up based on a field that is unique to them.
BTW, you don't have to use the tag prperty on any node if you don't wish to.
3. Just use a TreeNode object (see 1a)
4. There's plenty around that won't seem so convoluted once you've got the hang of them.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi.
How can we override OnFormClosing method ?
Science doesn't limit
Science is for everyone
|
|
|
|
|
in inherited form just add this code
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
}
in msdn said :
Notes to Inheritors When overriding OnFormClosing in a derived class, be sure to call the base class's OnFormClosing method so that registered delegates receive the event
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Thank you my friend
|
|
|
|
|
hi every body
i want know how can i search in text files (*.doc,*.txt)
by c#
I want give the program specefic folder and it will search in all files in it
how can i do this ??
thanks in advance
|
|
|
|
|
i dont know about *.doc files cause the format is different from *.txt
Youll use the DirectoryInfo class to get a list of all the text files within it.
then you can foreach that list and inside the loop create a fileStream that you point to the path of the current item in the loop. You then need to create a StreamReader and point it to your fileStream. you can then declare a string variable and call StreamReader.ReadToEnd(). after that you can use String.Contains("Text your looking for") to see if you text is in fact in your file!
Heres an example in C#
DirectoryInfo dirInf = new DirectoryInfo(@"C:\");
FileInfo[] files = dirInf.GetFiles("*.txt");
foreach (FileInfo currentFile in files)
{
FileStream fs = new FileStream(currentFile.FullName, FileMode.Open);
StreamReader reader = new StreamReader(fs);
string fileContent = reader.ReadToEnd();
if (fileContent.Contains("the text your searching for"))
{
MessageBox.Show("The File " + currentFile.FullName +
" Contains the text your searching for");
}
fs.Flush();
reader.Close();
fs.Close();
}
remember to add using System.IO;
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi
I am a university student and working on assignment convert swf to exe file. From the last two days I have searched a lot, i found softwares written in C# that can do it but didn't get any programming help how to do this.
Thanks in advance
|
|
|
|
|
Okay, i found this: http://bytescout.com/swfscout_flash_demo_exe_to_swf.html[^]
Which is taking the swf out of the exe, it also comes with source. I'm not sure what language it is since i didn't look but...
Anyway, if you know how to take the SWF out, then that means you know where to put the SWF back in. So you may be able to figure it out from this.
Remember, if you get stuck with a specific problem then feel free to ask away.
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Dear Sir,
Thanks for your reply i have found the link there to convert swf to exe. http://bytescout.com/swfscout_flash_demo_swf_to_exe.html. But the downloaded file is not working. I have seen some help on this site too, I will try myself and hopefully i will extract some data from the site. If I will I will contact you. Hope you will help me.
Thank You
|
|
|
|
|
Hi everyone,
I'm working on a solution were i have changed the default namespace to something like the following (in a class libary):
XGSDev.XeroxOrderTracking.OrderTrackingService.ComsLayer
Now i've also used some web references too. The problem is that the webreference do not follow this namespace. They are instead at ComsLayer.<what ever="">
I would have expected
XGSDev.XeroxOrderTracking.OrderTrackingService.ComsLayer.<web service="" name="" here=""> to be correct.
Normally this isn't a problem but now because of this i'm having lots of ambiguous variables and methods.
I'm sure i'm missing something simple but i can't think what it is.
Thanks
Phil
|
|
|
|