Jeffry J. Brickley wrote:
They are the same people complaining about XP when XP first came out
So true, and they will be the same people in the future saying "Windows 2012 is crap, stick with Vista!".
Jeffry J. Brickley wrote:
They are the same people complaining about XP when XP first came out
So true, and they will be the same people in the future saying "Windows 2012 is crap, stick with Vista!".
"Anyway else getting ready for the Penguin" So you don't like choosing between 7 versions of office?, you will love navigating through the hundreds of different versions/distributions of linux.
System.Threading.Thread.Sleep(1000); will pause the thread for 1000 milliseconds.
You don't have to use properties if you prefer not to. Virtually everybody does though, as they make code much easier to understand.
webBrowser1.IsWebBrowserContextMenuEnabled = false;
This is a better way still. Using execeptions is not a good idea. private void AmountBox_KeyPress(object sender, KeyPressEventArgs e) { if(!char.IsNumber(e.KeyChar)) e.Handled = true; }
Hi, I am currently suffering the limitations of the listbox control, I would really like to have a generic listbox, rather than the default of using objects. It would also be really useful if I could make a custom listbox and override the functions "Items.Add" and "Items.Remove", but I can't work out how to override these functions. I am not sure if these things are even possible, I haven't been able to find out much about them googling the web, can anyone point me in the right direction? thanks
Use the navigating and documentcompleted events if you want to know when the browser starts and finishes navigating. Alternatively, if you want to know how much has been downloaded and how much needs to be downloaded of the webpage, use the e.CurrentProgress and e.MaximumProgress properties of the progresschanged event of the webbrowser.
ahh that's great, works a treat, thanks.
Hi, I have a class running on a secondary thread that listens to an IRC channel (don't worry if you aren't familiar with IRC, all this code is working), and fires an event when it receives a message, passing on this message on. The problem is that I need the main thread to do all the business once a message is received. Attaching events in the normal manner causes the code fired by the event to be run on the secondary thread, which is not good. So basically; how can I attach an event handler that runs on my main thread to events fired on a secondary thread? Hope that all makes sense, I have done lots of searching but cannot find what I'm looking for, this is partly because I'm not really sure what I am looking for, as I am totally stuck. thanks Martin
Ah, most helpful, thank you very much!
Hi, I want to make the tab for my program flash in the taskbar, I have done some googling, and found the following code: using System.Runtime.InteropServices; [DllImport("user32.DLL", EntryPoint = "FlashWindow")] public static extern int FlashWindow(int hwnd, int bInvert);
But unfortunately I have not been able to get it to do anything (calling it has no effect), in fact I don't even know what the int parameters refer to. Can anybody give me a prod in the right direction? Thanks! Martin
thanks, worked great!
Hi, I have an application where users can do many find/replace operations, including regexes. The problem is that if the user wants to replace something with a carriage return/newline and enter \r\n
it literally replaces with "\r\n", however if I try the same thing but in the code, and specify a regex to replace something with \r\n
it does replace with a carriage return/newline. Otherwise the regex works properly, for example the user can find a carriage return/newline with \r\n
and they can replace with $1
for example, but it just doesn't work when you try and replace with \r\n
. thanks for any help!
I am making a program to help with editing Wikipedia (you know, the free encylopedia, see http://en.wikipedia.org/wiki/Main\_Page). I can get and change the text in the textboxes, but I need to be able to press the "Save page" button when done. For an example of a webpage I am trying to press a button on see http://en.wikipedia.org/w/index.php?title=C\_Sharp&action=edit hope that explains it a bit more. thanks
Hi guys, I have a program (in Visual studio 2005) that interacts with a webBrowser component, it needs to press buttons on webpages in that webBrowser, so far I have done this by focusing on the button then programmatically pressing "enter" as follows; webBrowser1.Document.GetElementById("button1").Focus(); SendKeys.Send("{ENTER}"); This works, but is less than satisfactory, because if the user starts using a different application it fires the "enter" key in the other application. This can mostly be avoided by checking my application has the user focus, but then if it doesn't have the user focus the "enter" is never fired. Is there a better way of programmatically pressing a button on the webpage? thanks a lot Martin
Wow, thanks Will, thats perfect! I'll remember to pass your kindness on to someone else! (plus I'll get a book on threading in .NET ;) ) Martin
Yes that does help, thnaks! Further problem now is how do I stop the progress bar? because if I put the code to stop the progress bar in the new thread, then that makes the progressbar disappears altogether when the thread finishes (why is that?), and I can't put the code like this; Private void getWebData() { progressBar1.Style = ProgressBarStyle.Marquee; progressBar1.Value = 100; //start new thread to do everything progressBar1.Value = 0; progressBar1.Style = ProgressBarStyle.Continuous; } because then as you would expect it starts and stop the progress bar imidiately. I assume I have to somehow attach an event handler to the new thread so I know when it finishes? thanks Martin
Hi, I am making an application that simply gets all the html from a webpage and filters out the data I want. The problem is that I want a progressbar to indicate it is working (using the "marquee" style). My code looks like this; Private void getWebData() { progressBar1.Style = ProgressBarStyle.Marquee; progressBar1.Value = 100; //simple code to get wepage... //simple code to filter out data I want... //put data into listbox progressBar1.Value = 0; progressBar1.Style = ProgressBarStyle.Continuous; } I thought that this would set the progressbar going, then do the work, then stop the progress bar, but instead the progress bar just doesnt do anything, although the code to get the html data does work. Any comment greatly appreciated, thanks! Martin.
Hi, I want to add a spell checking textbox to a c# project I have, is this possible? I have all the relevant software (WinFX runtime, extensions for VS2005 Express etc.) but there is no way to enable the textbox.IsSpellCheckEnabled property I have read about. Is it possible to make a custom WinFX control which is a spellchecked textbox, then add that to my project? If so is there any documentation on how to achieve this? thanks!