Relative Content

Tag Archive for c#.netwinforms

Show form on top of parent during background work

Not sure if doing myForm.ShowDialog() during a background worker is the issue, but in my application, I have a background worker check for data, and if the data is empty, I do myForm.ShowDialog(). The only problem is, it will show up underneath the parent form, but still be centered relatively to parent when I have CenterParent set as the start position. From my understanding ShowDialog() should make the form show on top by default, but wondering why its going underneath.

Winforms custom user component returning errors when used after being packed as NuGet

I am trying to use a user control component I created and packed in NuGet and I get some errors. When I test the component in a test form within the same solution, by referencing the project, then it works correctly, when I pack it and install the NuGet package in a different solution and try to add it to a Windows Form project then I get this output:

Can’t recreate an object in .NET Winforms 4.8.1 C#

I’m trying to make a settings program for a project I’m working on, and I need a way to unload objects (specifically pictureboxes and labels). I probably will need the objects later, but I don’t want them constantly loaded in memory, because I want to make my program as lightweight as I can.

Can’t recreate an object in .NET Winforms 4.8.1 C#

I’m trying to make a settings program for a project I’m working on, and I need a way to unload objects (specifically pictureboxes and labels). I probably will need the objects later, but I don’t want them constantly loaded in memory, because I want to make my program as lightweight as I can.