C++ GUI: Simple Hello World App with Labels in Visual Studio | WinForms
Вставка
- Опубліковано 19 сер 2024
- I made a template for this project recently, with it you can avoid the hassle of creating the project. Just choose the template, create the project, you are good to go!
Watch this video to learn more about using it: • C++ GUI: Create Simple...
Download it here: marketplace.vi...
In this video, I will teach you how to make Windows Forms Application in C++ using the .NET Framework. We will use the CLR component to make this project. However, the template isn't available from Visual Studio 2012, so we will have to build it manually. So here is the link to the Main.cpp file I used :
www.sciber.ml/m...
The process is simple, first we will create the Windows Forms Application from Scratch, however it will be super easy. Next we will add a label from the toolbox and voila, you will run a nice Windows Forms Application made using C++.
Make sure to Subscribe us for more future videos. Stay in touch with more amazing Videos here on UA-cam.
Join Us on Telegram: sciber.web.app/tg for updates!
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void main(array^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
YourAppNameHere::MyForm form;
Application::Run(%form);
}
HaHa sorry😂
Oof,this is much more complex than java GUI
Yeah right
Well, can we style the gui using c++,C# is better on styling.
How about if u want to link the button in the toolbox to another form? Is this the same code to use?
Please use Dark Theme in VS. Light attracts bugs
Damn! Thanks dude 😁😂😍
Lmao, I feel ya
Lol
yeah.. im searching for design! thank you! now i can make something better than just black window xd
😁
Wow that's the Best thumbnail
The pair of glasses killed me
🤣
I definitely need a pair of glasses
😂😂😂 dude I made a video about that, you can watch it
If your form designer is not working and not showing while right clicking the project or by pressing Shift + f7. Close the project and open it again. This will fix it.
Yeah. No need to close though, unload it and the reload it. It is much faster. Not much of a difference though ✌️👊
Scriber - "sit down and do what i do " , Me - Yes Sir!.
😂❤
I have a C4829 compiler warning. How do I resolve that?
When I click add new item I can't find anything that says UI
That means you havent installed the c++/cli build tools. Watch this video and install properly. Then you should be good to go. ✌😊 ua-cam.com/video/HcxlYkU8aY0/v-deo.html
There are no tools in the toolbox for me (Visual Studio 2019)
And in the MyFrom.h i don't see a window i just see the code
Try this please, I think your installation is not right ua-cam.com/video/HcxlYkU8aY0/v-deo.html
repost:
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void main(array^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
YourAppNameHere::MyForm form;
Application::Run(%form);
}
Why repost 😅🤔
when I double click MyForm.h it doesn't give me the design. it gives me the code of it
I don't know what is causing this problem, but it happens to all of us, I just close the solution and reopen it and then it works. You can restart visual studio if that also doesnt work out. Anyhow, after that mine works always
oh God, thanks for telling me to restart it. it finally works. that took so long tho lol
Can you guide about what you have done in main program?
Im sorry your comment got lost somewhere, so I'm making a large tutorial (lile a masterclass) where i go through all of those details about Winforms. So please stay tuned. It will take a lot of time for sure. But I will publish it eventually.
this is great for me .thank you so much :)
i am starting with u 13 / 8 / 2020 , i am waiting to the results,
thanks man 😊
Awesome bro
My toolbox is empty, help!
hey, i installed everything needed, but my toolbox is still empty.. u know any solution for that? (visual studio 2019)
Sorry dude, doesn't ring a bell. Stackoverflow? 😐
i have the problem
I solved it by right clicking under "search toolbox" and check "show all" button
@@dARNEZcr000life saver, i spend more then one hour trying to do that, thanks!
Maybe re-enter I faced same problem and I just re-entered
Hello, I found your video and it is very good for a new user. My only issue is you talk really fast so I am not taking in all the info and have to watch several times.
Thanks for making the video.
Can't Find the form option in vs2019 following your example.
Oh actually I am flattered 😂 English is not my native tongue so it is a bit strange to hear I am too fast. But if you want you can play the video with a slower speed like 0.75.
Please follow this video ua-cam.com/video/HcxlYkU8aY0/v-deo.html to solve your issue
@@wearesciber Thanks for the replies and the great videos. Liked and Subscribed.
i was going to download the software VS2019, but after watching this video... I cancel it (to download). I think I just stick to VS2008 instead of complicated steps shown in the video.
But the upgrade might worth it. But yeah, it is quite the hassle.
system is not a class or namespace error in .pp file and Application too ....
Waiting for your guidance bro ....
Bro I think you didn't choose CLR project when creating
Great stuff. Thanks very much.
Glad to hear ☺️👻
We need more tutorial video like this! You & your work is fabulous!
Sure, will continue these videos.
Thanks btw
Btw, the 2nd video is out. Watch it here : ua-cam.com/video/DyC78GYgiRU/v-deo.html
When I double click on MyForm.h it just opens the code, not the Design :(
But when I debug it, it shows me a window. Any Help?
Yeah i suppose you are using visual studio 2019. If so, just close the entire solution and then reopen it. Then once you open the MyForm.h it would show again the code. Just right click there and click on view designer. This should do it.
@@wearesciber It worked thx
@@dennis2599 so glad it worked. 😃
Ok, now I have another error 🙂
@@dennis2599 yeah yeah tell me😁
I didn't find "Windows Form". Didn' t i download that?
Looks like you havent installed CLR
@@wearesciber I dodnt see CLR anywhere with 2019. Maybe make a video with newer versions. More people will be able to follow.
Gary Carlyle you need to install a clr application which I don’t know what name it is in English
@@nichtpedro2978 Yes I found a CLR download from Microsoft for VS2019
Gary Carlyle you need to install it in the vs installer I think you need to go to single downloads
alot of the steps you did are either not there anymore moved or not appering on my screen is there anyway i can just download the finished product
Yeah, I made a video on that ua-cam.com/video/HcxlYkU8aY0/v-deo.html
Watch this
i can't find the CLR format.. and also can't find the UI item..
Watch this ua-cam.com/video/HcxlYkU8aY0/v-deo.html
Can you make a tutorial of using c++ with sqlite
i cant find any clear tutorial on youtube
I'll try to
@@wearesciber
Many thanks 👀👍🏻
@@wearesciber Did you ever do one. I want to use sqlite with a form
not yet bro 😢
hello I have a problem with adding a background image. After the run, it shows the error "'Could not find any resources appropriate for the specified culture or the neutral culture. Make sure CppCLRWinformsProjekt.Form1.resources" was correctly embedded or linked into assembly " how to fix this
thnkyou
You sure you used the correct project template, because the project name as I see it, it isn't the one we need.
Have you cover all topics?
Can you give the link of offline visual studio please. I need this.😔😔
I can't post the link directly here on UA-cam. But I am pretty sure this site isn't malware. So go-to getintopc.com and there search for Visual Studio 2019 and then download. It is quite a huge file about 20gb size so....
@@wearesciber i know getintopc thanks
@@qazisyedmuhammadali3497 ✌️👊
how come when i click the myform it only shows the code but not the design someone help pls
Right click on project - > unload project
Then
Right click on project - > reload project
Sorry, this not c++ form, this is .NET and C# form
.NET and C++ bro. The language we are using is C++. Of course it is the .net framework.
@@wearesciber Actually I want to learn Win32 API (Rare to see on YT). I want Visual C++ PE header and not a .NET
Yeah yeah that would be so hard. The api is very low level and therefore hard to code. But it is pretty damn fast. Anyways compiling a tutorial might need lot of time and effort. However I will try to give the best to my audience. So I will try "in the near future" to give you guys that tutorial. 😉
I followed all your steps but when i copied the code and debugged the form it gave me alot of errors such that form(on the last line) was undeclared identifier.Also in (Project1::MyForm form;) line it showed that their was a syntax error becuase a semicolon was missing before the identitifer 'form' .CAN YOU PLEASE HELP ME.
What is the name of your ssolution/project?
You should replace Project1 with the actual project name
use this insted of the one provided : [STAThreadAttribute]
i have problem with toolbox there is no tools in it i dont know the problem?
Maybe your installation is not right, please check this ua-cam.com/video/HcxlYkU8aY0/v-deo.html
i downloaded visual studio 19 from microsoft site and i can not find any thing like clr and ui ..
please help me ..
the link for offline installer does not work with me.
Under your Visual Studio Installer click modify. Then Individual components tab, find C++/CLI support for v142 build tools (14.25) (VS2019), C++/CLI support (VS2017)
@@Gillis785 thank u ♥️♥️♥️ it's working
@@pain4743 No problem, glad I could help.
@@Gillis785 thanks you :))
I always get unresolved external symbol _main ...Such a bullshit error!!!!!
Please HELP ME SIR!
I think the problem is with linking... Probably should check the linker settings, please change entry point to main
@@wearesciber BRO that doesn't work too....
U sure u followed the exact same steps. Maybe u could send me ss of linker settings, error message and just visual studio
instagram.com/cybercafesl
Try double checking the configuration. Like may be it is set to x86 and you r editing the 64bit configuration. This usually happens all the time. The reason that I could not give a proper answer is that I don't have enough data please. If you can please send me a screenshot... 👊
Nice video, please do more about it
Thanks bro!
Really appreciate your comments
Hi, the second video is out. Watch it here ua-cam.com/video/DyC78GYgiRU/v-deo.html
Please tell where can I study about that code
Like any book..
I mean u could use Microsoft documentation
i am using Visual Studio 2019, Everytime i run Local Debug Manager, it will show " unable to start program. "c:\\demo\demo.dll" . the system cannot find the file specified."
Any idea to solve this ?
I haven't encountered that error brother. I will have to find out more. Also make sure you followed the steps correctly. Anyways you can download a demo project and follow along. I will send you the link.
Hey here is the link:
downloads.cyberweb.ga/lesson1.zip
Download this and follow along. Tell me whether the error is still occurring.
you know what ? your's file is ok !!! i need to start again to check what's wrong. . . will update you tomorrow. thank you.
@@fy9090 good to here that. 😀
After i ran your file, now the new project works ! thanks for your help ! I have subscribed and please give more lessons. xD
What do I do if my project name is Project-Example 2.0
Try typing it, soon you'll see something similar to it in the intellisense code suggestion drop down.
@@wearesciber I did ProjectExample20 thanks
Hi sir, when I runned it, It worked but there seems to be no title and It can't seem to display any elements.
You sure you have installed it correctly ua-cam.com/video/HcxlYkU8aY0/v-deo.html
thank you very very much 🌸🌸🌸🌸🌸
Top Sites: thepiratebay
omg, I'm dying
Oh no no no no 😂🔫...
"I have the right to remain silent"
I receive the following error when I try to run the program:
Code: C1001
Description: Internal compiler error.
Line: 16
What could've caused this?
Thanks. :)
Unfortunately I cannot predict what's happened because first time I have seen such error. If you could please google it maybe on stackoverflow. But anyways I will also try to solve. 😪
Same thing, even though i got the latest version
Btw commentor, what code is line 16
Also please do me a favor and try using my project file and see whether the error is still there...
downloads.cyberweb.ga/lesson1.zip
@@wearesciber
The code at line 16 is just a bracket:
{
so I will show you lines 15-17:
public ref class MyForm : public System::Windows::Forms::Form
{
public:
Not trying to be negative but the end result is pretty underwhelming, should've at least continued filling that window. Great video nonetheless!
go ahead. be negative.
this is not a vidro about UI design this vidro contains how to create a c++ form application
@@ramsey2155 your "end result" isn't even remotely close to what you showed at 0:35. Don't waste my time
@@marjotoska what you are doing is opening a math lesson and suggesting to learn english
you can find very interresting UI design tutorials in youtube
if you wanna make something interresting dont waste your time by writing negative comments go ahead and watch your important vids
Hi Marjo Toska, I just wanted to say that I have a complete series dedicated to this subject (you could even say my whole channel is dedicated to this) so what you saw is just the tip of the iceberg, so please I encourage you to research just a little bit before complaining. No worries.
I can't turn on the design view please help
Close and reopen the solution.
Can you make a program to compute grades in c++ UI Application form using Boolean logic?
Would take some time because the channel is paused for like 2 years... Sorry dude
5:27 where's that link dude?? Also not in ur description
www.sciber.ml/main.cpp
This is the new link and it was in the description. Sorry for the hassle.
whatever you have shown here is not exactly similar to 2019 ui is not available clr this is also not available
Watch this and fix VS 2019 ua-cam.com/video/HcxlYkU8aY0/v-deo.html
@@wearesciber ok thanks
I hope you continue about visual C++ to advanced and real project. Please
Yes sure... The series will continue and then once everybody has the basics, we are good to go with some advanced stuff. 💪
At 3:46 i dont have a ui option
You have to modify the installation and add "c++/cli support for v142 build tools"
Later, you'll have to add the following code to "MyForm.cpp"
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThreadAttribute]
void Main(array^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Project1::MyForm form; //Name of project, name of form, delete hyphen //Modify Example71
Application::Run(% form);
}
Yeah the problen is that microsoft has removed the C++ WinForms template from the library. That's why we create it manually. FYI if u have used VS 2010, the template is there of course.
If u can't follow the steps unfortunately, the problem is with the installation of Visual Studio. Try installing a complete C++ version and also install tye .NET tools. Also take a look at Santi Guzman's ideas, that's right I believe. Good luck.
😌
Thanks Guzman
Ye i figured how to make guis without the ui option
Thanks
@1:49 You are very wrong. 2015 != 2019 AT ALL! CLR does not exist in 2019. Perhaps 2019 Enterprise has CLR, bur 2019 Pro does NOT have CLR.
It exists, I used and even most people here used and made projects too. Do a little research please
Really great explanation.
Glad it was helpful!
Can we make simple GUI in VS Code ?
No
Sir, I have an error called C1001 (Internal compiler error) when I start debugging what to do sir, please help me.
Hi, let's try this. Download the following project template and install it. Then use it to make a new project instead of using CLR Empty Project. (also no need to set linker settings or add new form, just create the project) Run the program. Tell me if there's any errors. :)
@@wearesciber Sir , it did not work . So I reinstalled visual studio. Now it is working perfectly.
Thank you for helping me out .
Perfect, let's start creating some stuff 😍
Quick question: I really hate vs2015, so I am using 2019. Which individual components do I have to import? If I import everything that has to do with c++ (Not components, the entire packages) clr doesn’t show up. Tho not all individual components are selected. So do you know which to select?
Watch this please ua-cam.com/video/HcxlYkU8aY0/v-deo.html
Hi, I am extremely sorry, your comment got lost somehow, so... I made a video on this already, here it is: ua-cam.com/video/HcxlYkU8aY0/v-deo.html
is the windows form application c++ or c# ?
Well actually we did coding in C++. But the code is depending on the .Net framework. So we are using .Net and not C#. C# is using .net too.
So the answer is the app is C++.
cyberweb.ga/main.cpp doesn't work
I am sorry but * cyberweb/cybercafe is not associated with our company anymore* . Check sciber.ml/main.cpp
Thank you for the feedback!
@@wearesciber ah, thanks!
@@wearesciber Although, I already re-typed the code.
Haha legend #respect 😂
@@wearesciber Thanks! 😂
Also looked more professional on my discord live stream, lol.
One and only? Im quite sure there are dozens on here. Maybe not as good but you put me off a bit with that.
I have to say its a very good tutorial. Sorry If I were a bit moody.
Some fault in me too 😂👍
Downloads link doesn't work :'(
Which one?
see the code from video and type
@@NSTuts 😂😂😂. Thats epic! But links work 😕
will this work on mac as well ?
This tutorial is for Windows so No. But, you can through Mono, but it will be different than this. Look into that.
Is vs 2010 good in 2020
I haven't used it on Windows 10, but I used it on Win7. But I am pretty sure that it should work pretty fine in Win10.
Btw, I think it is better to use the latest version because you'll loose more features for something that is absolutely not a matter. So I would recommend the latest one. But for just learning purposes it is fine to use VS2010 because it works fine with even older PCs. 😊
@@wearesciber currently I am using vs 2010 on window 10 machine it is working properly so can use it for more time.
@@amansaxena9794 Yeah, it is totally fine!
Thank you so much sir.
Sir how can we use file handling in windows form application in c/c++.also can we use file handling of c language.
pls make client side online app GUI in C++
Bro. What? You serious
How often will you upload?
Hi, the 2nd video is out. Watch it here ua-cam.com/video/DyC78GYgiRU/v-deo.html
Is it all .net?
Yeah
Did india shift to usa??
using fake location./
No I can fly ☺
Plus if you have seen my other videos you would have noticed, i obviously use a lot of weird locations and that's just for fun. And tge location thing is not that of a big deal too.
Sir your videos were really really helpful i just wanted to know is there a way i can contact you i have a doubt related to my software project
You can contact via facebook.com/scibersl or instagram.com/thisismalindu ☺
Excellent!
Thanks
Please Please SLOW DOWN :)
🙄 What do you mean bro? =)
This is not C++, this is C++/CLI.
Your voice is not clear
Oh I'm sorry, why?
you didn't explain how to fix the error and you talk too fast.
😂🔫
Love you brother 😭 😭😭😭😭❤️❤️❤️❤️❤️❤️❤️❤️ it's working ❤️❤️
Haha ♥
bruh this is not a tutorial; we dont learn how to code it
instead its learning how to use visual studio 20MB preset rubbish
Okaaay, 🙂👍
Getting arror
what is the error?
9/3/2021
Wait what 😅
Futness!!! :)
Tnnnnn mage yaluuuu
❤
💚
💪💪💪❤️
Eat code and exercise
LOL 😉😂
Thanks
No problem