WPF Desktop
Registration Form
“Name. Email. Dropdown. Submit. A form that actually works.”
What you will have
A WPF registration form with name, email, a dropdown for country, a submit button, and a clear button — with basic input validation.
When you click Submit it checks all fields are filled in. If something is missing it shows a friendly error. If everything is correct it shows a success message.
Video Walkthrough
Watch the full lesson walkthrough.
Your prompt
Copy this. Paste it into your AI. Hit Enter.
📋 Your Prompt — Copy Everything Below
Create a WPF registration form in C#. The form should include: a TextBox for full name, a TextBox for email address, a ComboBox dropdown for country (include at least 5 countries), a Submit button, and a Clear button. When Submit is clicked, validate that all fields are filled and the email contains an @ symbol. If validation fails show a friendly error message in red. If validation passes show a success message in green. The Clear button resets all fields.
✅ Copied! Now paste it into your AI.
What to do after
Follow these steps exactly.
1
Create a new WPF project
Visual Studio → WPF Application (C#) → name it RegistrationForm → Create.
2
Replace both files
Replace MainWindow.xaml with the XAML. Replace MainWindow.xaml.cs with the C# code.
3
Press F5 and test it properly
Try submitting with empty fields. Try a bad email. Try filling everything in correctly.
4
Try the Clear button
Fill everything in then click Clear. All fields should reset.
🛠️ Didn’t work?
Remember — WPF has two files. Check XAML and CS are in the right places. Then:
1 Look at the error list at the bottom of Visual Studio
2 Copy the error message
3 Say: “This didn’t work. Here’s the error: [paste it]. Please fix it.”
Vibe Tweak
Add your country to the dropdown.
Open MainWindow.xaml. Find the ComboBox section. Add your own country to the list if it isn’t already there. While you’re in there — add three more countries you’d like to visit.
Extra Credit
Want to go further?
📋 Extra Credit Prompt
Add a password field to the registration form using a PasswordBox. Add a confirm password field. On submit, validate that both passwords match and are at least 8 characters long. Show specific error messages for each validation failure.
✅ Copied!
Reflection
Before you move on — think about this.
“Every website signup form, every desktop app registration screen — they all work roughly like this. Can you find the line that checks for the @ symbol in the email?”