Windows form renaming form removed all control - c#

I’m new to c# and windows forms, but not programming. I have a windows form project I’ve been working on and I thought I might change the name from form1. When I did that I noticed that my form[design] completely reset. It was still running properly until I rebuilt the project. Does anyone know how to restore my original form design? It seems like all my controls still exist somewhere, when I add a button to the blank form it defaults it to button3.

Related

form1.show() does not work after adding WebBrowser to windows form

I have a weird project I'm working on that is a summation of AngularJS, NodeJS, C# written as a Microsoft solution (.sln) project package. The issue I'm having is that I would like to make a windows form that has the WebBrowser .NET component within it. When I press the button that prompts the form to open, nothing happens. However, when I delete the WebBrowser component from the form, it opens just fine. I've seen from past posts that this could be a threading issue, but if you look at my code snippets below, you can see that I've tried it and still have the issue:
app-bar.component.html: (where the button is called)
app-bar.component.ts: (method that correlates to the html button)
form1.cs: (since the button is on form1, this is where I create the form3 and have the show method)
form3.cs: (windows WebBrowser form)
form3.Designer.cs
Please let me know if you guys have any advice, would be much appreciated!

Font rendering issue when running app from taskbar

I've researched this a bit and can't seem to find an answer. A few articles here on SO also go unanswered or provide answers that don't seem to work so I'm running out of luck and hoping someone can help.
I've got a WinForms project, coded in VB.Net, using .Net Framework 4.6.2.
I wanted to the app to load in the system tray, and when clicked the actual form comes up. I got this to work using feedback from another article which implies creating a separate Module, include a Sub Main() declaration, load the Notification item in there and when system tray icon is clicked then load the main form.
To do this, I had to go to my project settings, select the "Sub Main" as the startup object, and un-check the "Enable application framework" box.
Everything works as it's supposed to, the notification icon is loaded in the taskbar, and when clicked my form opens up.
Here's the issue, when my buttons are rendered they look way different than when I setup the project to run the form instead of the windowless module. Example:
Buttons should look like:
But look like:
A few articles pointed to enabling the following options in my main module:
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(True)
Application.DoEvents()
This fixed the way my ListViews were rendering, but not the text. As you can see in the images, the top one is much more smooth and well-spaced than the bottom which looks bolder and misaligned.
I've tried changing the form's AutoScaleMode settings, AutoSize, and nothing works.
Any idea on how to fix this?
Setting the default font of the form worked, as #Çöđěxěŕ recommended.

MDI Child Form is scaling to the wrong size

I have an old C# winforms project I have support for several years now. In this project there is a main form that is an mdiparent and each other form is a child that fits inside the blank area of the parent. This has never been a problem.
Now I am trying to make modifications to this app again, but I do have a newer version of Visual Studio (2015) than I used to. So there is only ONE child form in this app that is giving me trouble. If I revert all my code, open the project, build, that form will appear/scale correctly. If I revert all my code, open the project, open the UI of the form, build, it will shrink the child to a smaller area inside the parent. It only happens on this ONE form, the rest work fine.
I have tried messing with all forms of autosizing, scaling, window size settings, etc but I think its something in VS that is causing just that one form to auto scale incorrectly and I'm not sure what it is. If I look at the auto generated code and compare it to the other forms it will set AutoScaleBaseSize to (6,15) but other forms are at (5,13). If I do like I mentioned above and revert the code but do NOT open the form, the autogenerated code for that form is (5,13) like the other forms.
What is happening in Visual Studio to change this AutoScaleBaseSize property and how can I find the culprit?

I can't click on Telerik controls in my WinForms application in Visual Studio

I’m having an issue w/ a WinForms app I built several months ago. I opened it yesterday for the first time in a few months, and I’m unable to click on any of the controls in the form (in Designer view). If I double-click any of the controls on the page, it opens up code for the Load event of the form, as if I double-clicked the form itself; it’s as if the form is on top of all other controls maybe? All of the controls on the form are Telerik controls. I've been working on this project in VS 2010 since its inception. I also tried opening it in VS 2012 this morning, but that didn't help.
If I drag a new Telerik control to the form, it vanishes instantly, as if it’s buried under all of the other controls. If I drag a non-Telerik control to the form (such as a standard textbox), it appears fine, and that control will respond to clicks (ie – the Properties window will populate w/ properties for that control).
After I noticed this issue yesterday, I reluctantly upgraded my Telerik WinForms controls to Q3 this morning, but that hasn’t helped anything.
For now, I was able to bypass the Designer view altogether, and I made changes via the Designer code class. However, I’ll be in trouble if I ever need to actually add a new Telerik control to this form. Any help is appreciated.
This seems like a missing design time assembly. Please have a look at the following articles for explanation and suggestions how to handle this: link link

Visual Studio C# 2010 adding/editing new additional forms to a program

So I am new to actually building GUI and I am creating a project where when you click on one button you open a new form. With this new form I want to be able to add and edit things to it.
In my solution explorer it is only showing the first form that I originally create, not the second one. I went online and used one of those little microsoft blurbs about creating a new form when a button is clicked, and I am a little lost from there.
My program is going to have multiple buttons that you click and they open certain forms. I understand that I have the button_click set to create a new form. I now want to know how to edit these forms that are created.
I tried refreshing my solution explorer and it wouldn't show my newly created design. (I thought that could be one of my possible errors, haha) Could someone please let me know what I should be doing?
First add a new form. Right click on your project (my project is called Test) and give it a name (I called it TestForm):
Then, add the following code to your button:
TestForm MyForm = new TestForm();
MyForm.Show();

Categories

Resources