Click here to Skip to main content
15,035,283 members

Comments by Groulien (Top 52 by date)

Groulien 4-Mar-13 15:42pm View
The real problem I'm facing is that a lot of events used to perform operations contain code like this:
previewProgressReport(openRepairJobs[(sender as ListBox).SelectedIndex]);

The new control can do more than the existing ListBoxes (internal reordering and more), that's the reason it's been requested.
I first tried to inherit from ListBox but that became an absolute mess because the items have child controls and the ListBox doesn't like irregular item heights.
Then I thought it might be better to go up the hierarchy (to ListControl) so that the ListBox logic wouldn't bother me.
We replaced all the (sender as ListBox) code with (sender as ListControl) to see if it harmed the existing code and it didn't.
The new control is derived from ListControl and is working quite well but the scrollbar is missing.
Groulien 4-Mar-13 15:09pm View
I access data by using the SelectedIndex of either the ListBox or the new control but I don't want to have to check types all the time (Don't want to have to check which is being used).
Groulien 4-Mar-13 15:00pm View
Current situation has a ListBox of which I use the SelectedIndex (defined by ListControl).
New situation allows the ListBox to be replaced (at runtime) by the new custom control of which I also want to use the SelectedIndex property.
(This new control does behave like a list)
By using the abstract class ListControl, I can switch the two more easily (at runtime).
If I use the ScrollableConrol then I can't refer to the same variable without having to check for its type.
Groulien 4-Mar-13 14:50pm View
The control has to be exchangeable with the 'ordinary' ListBox (doing this through the parent class) so that users can get used to the new interface but, in case they're confused, can still switch back. All I really need is the SelectedIndex property which they would both share (and I don't like additional type checking for it).
Groulien 20-Feb-13 14:25pm View
Even a simple form shows the issue.
It might not show on really powerful computers.
<window x:class="LagTest.Window1" xmlns="" xmlns:x="" title="LagTest" height="300" width="300">
<richtextbox name="Rich" grid.column="0" grid.row="0" horizontalalignment="Stretch" verticalalignment="Stretch"></richtextbox>
Groulien 8-Jul-11 3:19am View
Did you create this project in an older version of Visual Studio? If so, it's not trying to target C#4.0 and you're asking the wrong question.
Groulien 9-Jun-11 3:07am View
You're returning Outlook Express if you're unsuccessful?
Are you joking?
Outlook Express is REMOVED from Windows 7.
Just return a string.Empty if no default client is specified, I'm sure other programmers will understand.
Groulien 6-Jun-11 8:51am View
It's impossible for pluginless websites, but it should be capable with an app on the metal (machine).
Groulien 31-May-11 9:43am View
The code is correct, but he's asking it for ASP.NET and not for Windows Forms (I also posted a 'forms' solution and deleted it).
Groulien 31-May-11 4:48am View
I don't understand the question.
What 'task' are you talking about?
Groulien 19-May-11 9:36am View
Slow app = slow code
1. What kind of program are you working on?
2. Post the code.
Groulien 11-May-11 5:17am View
Not really helping.
It's like asking for a needle and being told it's somewhere in the haystack.
Groulien 11-May-11 4:12am View
If you were to compare all 4 (for,foreach,LINQ,Lambda) with the stopwatch and such, you could write an article. I'd read it to say the least.
Groulien 9-May-11 4:56am View
Don't you mean => ?
Groulien 6-May-11 8:36am View
Thank you for you solution.
It's true that 100% CPU doesn't necessarly block it, it's just that it happens in a lot of cases (here).
The 100% CPU simulation is a reasonably well known trick, nearly every beginner gets it rubbed into his face with the while(true) statement.
The tip for the PriorityClass was something that had completely slipped my mind, big thanks for that.
Groulien 6-May-11 8:07am View
Add -> Existing file
Groulien 6-May-11 7:59am View
You're killing yourself with these fake answers, like S.-J. said 2 times before.
Groulien 6-May-11 7:36am View
You're right that it's difficult, but that's also why I find it an interesting topic.
The act of filtering which processes should and shouldn't take 100% is something I had already taken into account (and thought you would assume that I would filter it).
Things such as Flash and IExplorer should not take 100% cpu for example and many games don't run at 100% for longer than 60 seconds straight.
Thanks for the feedback.
Groulien 6-May-11 5:24am View
GMail might give you a timeout because, like you said, it's sending 1 mail per minute and is afraid of spam.
Groulien 3-May-11 14:57pm View
It's looking good, I'll be sure to look into it, thanks.
Groulien 3-May-11 9:37am View
Besides the obvious joke, the link is actually broke.
I'd appreciate it if you would post a link to the article you're refering to.
Groulien 3-May-11 9:33am View
I'll look into it although the third(Which you call 2nd link) seems rather empty, it's not explained or fully implemented.
Still, thanks.
Groulien 3-May-11 9:31am View
I know of the Browsable attribute, it's the Design Time support for adding items of my new class that is bugging me.
Groulien 3-May-11 4:20am View
Where did the point end up being?Was it too far to the right, too low?
I can't use VS right now, but still rather eager to get it (this code) working.
Groulien 3-May-11 4:17am View
Where did the point end up being?
Was it too far to the right, too low?
I can't use VS right now, but still rather eager to get it (this code) working.
Groulien 2-May-11 8:15am View
It depends on the context in which the textbox is being used.
We need more background information as to the function of the textbox.
A textbox alone has no test cases, or does it?
Groulien 2-May-11 7:38am View
Nice, way cleaner than mine.
Groulien 2-May-11 7:29am View
Your English is horrible.
Please try to find a co-worker with better english and let him edit your post or find a better online translator.
Groulien 2-May-11 7:14am View
The heck?
You're replacing one character with the same!
Groulien 2-May-11 6:33am View
Won't compile, '' is not a character.
Use str1.Replace("\\", "") instead.
Sorry my friend, but no overload exists for string.Replace(char, string).
Groulien 2-May-11 6:29am View
Does that even compile?
I believe it's
str1 = @"123\456\789\10";
(The '@' disables the use of escape characters (\n, \t, \\, \").
Groulien 30-Apr-11 14:07pm View
Not clear?
He wants to make the text disappear when clicked upon, in what way do you want him to elaborate?
Is this simple curiosity or are you trying to solve a problem?
If you're trying to solve a problem, try posting the problem as well, it may lead to very graceful solutions (as in user friendly).
Groulien 30-Apr-11 14:02pm View
If you want to keep the data stored inside, change
textBox1.Text = string.Empty;
textBox1.Visible = false;
Groulien 29-Apr-11 15:44pm View
It worked!
--My implementation for documentation/google purposes--
It works by iterating through all the cells (CurrentCell property) and then using IsCurrentCellDirty and EndEdit.
Groulien 29-Apr-11 7:03am View
The Program.cs can't really be the problem unless you've put all the forms code (which I doubt).
By default, the Program.cs only opens a form, not code them.

What you coud do is add the following code to your OnLoad event and check if they are added to the controls collection:
<pre lang="cs">
private void OnLoad(object sender, EventArgs e)
foreach(Control C in this.Controls)
Groulien 29-Apr-11 6:13am View
You could try formulating the question like this:
"I would like to develop an event schedular that sends an email when the event occurs.
What do I need to learn in order to build such a system? What articles do you recommend?
With kind regards,
I admit, the question may feel a bit dumb but it's better in my opnion.
Like this, you're being polite and might actually get multiple different answers and you'll be able to pick the one that suits you most.
Groulien 29-Apr-11 6:09am View
Voting 5.
Groulien 28-Apr-11 5:38am View
The difficulty in making such an overlay is to get it over DirectX, but I'm sure it's possible (XFire did it).
Groulien 28-Apr-11 4:01am View
If this solution worked for you, please use the 'Accept as solution' button.
Groulien 26-Apr-11 8:54am View
Which exact line threw the exception and what kind of an exception was it?
Groulien 20-Apr-11 17:50pm View
Worked, thanks a lot!
Groulien 20-Apr-11 9:20am View
SMTP can't detect what app is sending, as long as you supply the proper credentials you should be fine.
Groulien 19-Apr-11 8:15am View
Don't you mean 'How to lock and unlock your Caps Lock'?
Thank the heavens that text-to-speech does not shout when using caps :p .
Groulien 18-Apr-11 5:35am View
There are a few things that bother me and please try to take this as constructive criticism, although I may sound like an *hole.
The answer first says it runs on Server 2003 and then says it can also run on NT/2000 and above, bit of a double answer. "powerful Web server", you're being subjective unless you compare to another kind of web server such as Apache. Please (try to) defend this statement by answering the following question:
Name a 'weak' web server and provide arguments as to why it is weak.
"One of the powerful tool provided by Microsoft to keep up-to-date of files system its keeps records of file history once we add files to source safe it can be add to database and the changes ade by diffrenet user to this files are maintained in database from that we can get the older version of files to." This is a very long sentence, try saying it as written (no kommas). 'Powerful', this is subjective to the experience the interviewee has with source control software. The fact that SourceSafe is being provided by Microsoft will probably be discarded as part of the answer because it is assumed you know this. Also: I personally don't know Visual SourceSafe, never even heard of it. If it is a prerequisite that you know SourceSafe, you're killing your interviews for some may simply use Team Foundation Server.
"Logically, partial classes do not make any difference to the compiler." Again, this will simply be assumed to be common knowledge
Boxing and unboxing? Really? This should be common knowledge to any C# programmer. If they don't know boxing and unboxing, it is easily learnt.
Groulien 14-Apr-11 9:07am View
Two tips:
1. You should either use the webclient in a 'using' context or call Dispose().
2. Versions usually aren't integers but a Version[^].
It might not support old versions but the title did say 'simple'.
Voting 4.
Groulien 13-Apr-11 3:55am View
Socket connection (tcp/udp)?
Connection to (my)SQL server?
And if one of the above, please specify what you mean with 'global'.
Groulien 12-Apr-11 10:23am View
'a wizard' and 'a log' doesn't give a clue wether you're talking Windows Event Logs or other log files. It's also a mystery wether you're talking Forms/WPF or ASP.
Groulien 25-Mar-11 7:28am View
And it's a lot more stable and less susceptible to file corruption.
Groulien 23-Mar-11 5:09am View
I meant to allow the user to add a row.
Groulien 23-Mar-11 5:08am View
Can't test this at the moment, will do it asap though.

But looking at Page_Load, I think we've got a small misunderstanding (I'm to blame) because I'm using a WinForms application and not WPF/ASP.Net (Page_Load is ASP, I think).

The trick might still work though, I'll let you know.
Groulien 17-Feb-11 9:49am View
I'm talking about dragging and dropping controls (from the designer) onto/into my custom control.
Groulien 18-Nov-10 18:19pm View
Thank you very much.