Archive for the 'MS.NET' Category

04 Feb

Solution: Invalid FORMATETC structure

I was making a ASP.NET components library and when I was ready with my library I made a Web Application project and started dragging and dropping to them my form.
To my surprise, I was not able to do so and I got following error.
The operation could not be completed. Invalid FORMATETC structure
Many of you [...]

24 Dec

Solution: Changing color of disabled checkbox or radioButton

Applies to: C#.NET/VB.NET (Windows Programming).
1. Making it gray
After being disabled, the checkbox and radiobutton control’s ForeColor turns contrast to the BackColor of the form.This behavior is good because it increases the readability of your forms.
But in some cases this is really not desired.
So in that case you can make the CheckBox/RadioButton gray by setting its
BackColor [...]

01 Dec

Collection was modified; enumeration operation may not execute

Collection was modified; enumeration operation may not execute
This exception is thrown when you are trying to delete items of a collection in a for loop or using a for each loop.
The ideal solution could be to use a for loop with a descending counter.
Problem:
for e.g.
If suppose you are executing any of following code snippets
1.
for [...]