|
Er, what? If you want to know what event is raised when a form is Refresh'ed, the Paint event is fired. If you want to know how to refresh a form, then use the Refresh method. If your form flickers, use a double buffer. I can't say more than that unless you provide a little more information.
|
|
|
|
|
How can I use a double buffer?
|
|
|
|
|
Write to a bitmap instead of the screen. On the Paint event, draw the bitmap.
|
|
|
|
|
You've given no more information than the person who's thread you hyjacked. SWtart you're own thread and provide a lot more detailed about what your issue is.
|
|
|
|
|
Computafreak's answer is enough for me, I didn't start a thread because I don't have an issue, I was just curious and wanted to ask a small question.
And of course the owner of this thread won't be able to get a proper answer because his question consists of three words.
|
|
|
|
|
A 7 word question is of the same quality, so you'd get about the same answer.
|
|
|
|
|
rule #1 in "how to answer a question" really should be: always keep the answer as short as the question".
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
Press F5
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Wow. Just...Wow.
|
|
|
|
|
It must be Thursday... I never could get the hang of Thursdays.
|
|
|
|
|
|
Buy a book
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
delete
modified 2-Apr-21 5:24am.
|
|
|
|
|
Put each IP Search onto a separate thread.
Whatever you sdo though the network response time is likely to be the limiting factor.
|
|
|
|
|
IMO bad advice. Using a few threads will help, launching tens or hundreds will result in hitting a bottleneck or a deliberate limitation inside the TCP/IP stack.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
This is really bad advice. Did you know that your allocating 1MB of RAM PER THREAD you create and keep running?
I'd look at using the managed thread pool before I start launching threads by the hundreds.
|
|
|
|
|
how would you change the code that it scan it fast or what would you add everybody said an other solution!
|
|
|
|
|
I'd design it so that I'd have about 5 or 10 or so threads all pulling IP addresses from a queue. Each of these workers would get an IP address, do it's job, report back, and then go get another address. You do NOT create a new thread for each IP address.
|
|
|
|
|
Hi
I have two ObservableCollections of an UserDefined Class which have an ID Property ,now i want to maintain 1 ObservableCollection locally and get another ObservableCollection from the DataBase,After i get them in one place i want to Compare those 2 ObservableCollections and delete the ID's from the local ObservableCollections which are not present in the ObservableCollections which is latest one(from Database).can some one give me the code for achieving this functionality.....Thanks in Advance
|
|
|
|
|
ramk_chirra wrote: can some one give me the code for achieving this functionality.....
That's not really the way that the forums work. If you have code that doesn't work, we will try to help you fix it, we won't write it for you.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
ramk_chirra wrote: Compare those 2 ObservableCollections and delete the ID's from the local ObservableCollections which are not present in the ObservableCollections which is latest one(from Database)
Why don't you have only one collection and each time you clear it and fill with latest data from DB? This will avoid unnecessary looping and deletions from one collection.
|
|
|
|
|
I was wondering if anyone has run into this problem and gotten around it in any way. Currently I am performing a front end conversion from a VB6 GUI to C#. It is quite a big change and therefore we are performing this in stages. Now in this process we currently are using "Microsoft.VisualBasic.Compatibility.VB6" array objects at times eg.RadioButtonArray, CheckBoxArray, etc.
Now when using these, there is a "SetIndex" method that is used throughout the existing code and it seems that the designer does not like the idea of this method being called when EndInit has been called already. It essentially renders the designer useless and we get an error in the designer. What we currently do is in the "InitializeComponent" method we call only "BeginInit" on the various arrays, and then in the form constructor after "InitializeComponent" is called we have another method we created called "InitializeComponentArrays" which we call all methods needing to call "SetIndex" and then we call their "EndInit" methods. This allows designer to load everything fine until we make any adjustments to the designer. When this happens, the windows generated code inserts all the "EndInit" methods into the "InitializeComponent" method which causes the designer to crash, and I then need to go in and delete the lines that it has entered. It is quite annoying and I felt it was time to reach out and see if anyone else has any better resolutions.
Thanks everyone!
Dan
|
|
|
|
|
Two suggestions:
1. don't touch the code inside InitializeComponent(), it isn't your code, it is the Designer's. And the Designer will change it any time it feels like changing it.
2. forget about SetIndex. If you need to easily access one or all of your checkboxes (or any other type of Control), create a collection yourself, by storing the references into a List<CheckBox> or something similar after your constructor called InitializeComponent(). A list accepts an integer index, so you can easily access the n-th checkbox if that is what you need.
Alternatively you can enumerate all top-level Controls of a Form, and pick the one(s) you need, like so:
foreach(Control c in this.Controls) {
CheckBox cb=c as CheckBox;
if (cb!=null) {
}
}
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Luc Pattyn wrote: foreach(Control c in this.Controls) {
CheckBox cb=c as CheckBox;
if (cb!=null) {
// now cb points to one of your checkboxes
}
}
This is where you can have the luxury of LINQ. How about
foreach (CheckBox checkbox in from Control c in this.Controls
where c.GetType() == typeof(CheckBox)
select c as CheckBox)
{
}
modified on Thursday, September 17, 2009 11:43 AM
|
|
|
|