Comment by Sinatr on C# DataGridViewComboBoxColumn Index out of range setting...
You should not manually edit xxx.Designer.cs files, they are meant to be generated by winforms designer and error is likely due to some manual edit. Revert changes (if you don't use source control yet,...
View ArticleComment by Sinatr on Use the subclass of a usercontrol as a base class for...
You can subsclass FlowLayoutPanel and put your methods there. Then multiple of custom controls should be editable in winforms designer without much effort. But I suggest you to rethink your design and...
View ArticleComment by Sinatr on C# DataGridViewComboBoxColumn Index out of range setting...
The debugger in Visual Studio should stop at problematic line with invalid index during run-time in debug-session. Add a design-time check for the code which is not intended to execute in winforms...
View ArticleComment by Sinatr on How do I manually maximize my Window?...
Did you mentioned this answer? It doesn't say "remove", it rather suggests to set None style temporarily. There are other solutions too.
View ArticleComment by Sinatr on New C# 13 features does not work on Visual Studio 2022...
There is 2022 version already.
View ArticleComment by Sinatr on Incremental Hash Using...
If I understand correctly, you implement your own HashAlgorithm and want to add ComputeHash(MyIncrementalHashCalculationState state, Byte byte) overload? Without seeing implementation it's kind of hard...
View ArticleComment by Sinatr on Bounds for C# Generic Random Array Generator
I am yet never used Random.Next parametersless overload, because I always need value in the range. To generate salt or something like random bytes I'd use crypto service. If min/max is the problem,...
View ArticleComment by Sinatr on Parallel logging without mixing up the log
The logging is IO bound, you can organize consumer/producer queue instead of calling logger methods directly and depending on log format multiple requests can be combined (bulk-written). I did...
View ArticleComment by Sinatr on What does "do while (...) {...} while (...)" mean?
That's one of the reason why people should learn blocks in C# and omit blocks for single statements: "Blasphemy! Our code convention is to always use blocks!". Many get used to always write if(...) { }...
View ArticleComment by Sinatr on DataGridViewCellPaintingEventArgs: Infinite repainting...
Changing Height in CellPainting is a bad idea.
View ArticleComment by Sinatr on How to implement unmodified shortcut keys in WPF?
Focus is a pain in WPF. The hotkeys are implemented using CommandBindings in WPF. I recall I had to merge those used in sub-view with ones from main window. I think it's possible to make with reusable...
View ArticleComment by Sinatr on Is there a C# attribute on a record field to exclude a...
With too many fields you may want to extract ignored fields into another record. This new record can work as a wrapper to hold ignored fields and original record (without ignored fields) as a new...
View ArticleAnswer by Sinatr for How to lazily evaluate C# anonymous class property
Rather than storing result as object, why not storing lambda, which retreives it?Changevar obj = new { Number = GetNum() };DoSomeWork();Serialize(obj);tovar lazy = () => new { Number = GetNum() };...
View ArticleComment by Sinatr on Use init SQL script in C# WPF apps
Is your question how to run sql-file? I guess using relative path to sql-file will work locally.
View ArticleComment by Sinatr on Event, when VS is closed in XAML application in WPF
What has application to do with Visual Studio? Are you debugging application in VS (debug session? profiler session? what session?) or is application a plugin for VS? The question is clearly XY problem.
View ArticleComment by Sinatr on Can I use Sharpshell library to put a commit hash to a DLL?
Is "when we upload a new DLL to a customer's system, we have no idea what DLL this is" the X problem? You are asking third question already pursuing git-commit visible to customer idea, but why should...
View ArticleComment by Sinatr on How to make custom user control able store content?
Try to use ContentPropertyAttribute to have 2 less lines, example.
View ArticleComment by Sinatr on How to store unknown number of elements in C# with...
Use .ToList() to materialize results of IEnumerable<T>.
View ArticleComment by Sinatr on DATAGRIDVIEW Cell SHOULD not accept value starting with 0
Here is example of good question on StackOverflow.
View ArticleComment by Sinatr on FileNotFoundException: Could not load file or assembly...
It may be a good case to "report a problem" to microsoft. They may look into it, ask for logs, instruct you how to get logs, look at first error in logs (totally unrelated), tell you something...
View Article