Jump to content

Windows Form Application example

1 minute ago, happyteddybearwithnobeard said:

Hi guys,

 

Does any of you have an example of Windows Form Application with fillable form that works?

What do you mean "fillable form"?

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, AluminiumTech said:

What do you mean "fillable form"?

Something like that:

With textboxes values saving in database table.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, happyteddybearwithnobeard said:

snip

It wouldn't be hard to set up and create a Windows Forms. The part involving saving to a database might be difficult.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, AluminiumTech said:

It wouldn't be hard to set up and create a Windows Forms. The part involving saving to a database might be difficult.

I am a newbie in programming world you know, I just need an example of it and then I can figure it out myself. I tried it, but I failed miserably.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, AluminiumTech said:

What do you mean "fillable form"?

You don't have to save anything to a database you could use json or XML to store your data. 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, vorticalbox said:

You don't have to save anything to a database you could use json or XML to store your data. 

Yeah, I could, it's true. I just call it database, my bad. But I want it to be a Windows application, I tried to make it, but I failed and now I don't know how to get back on track.

Link to comment
Share on other sites

Link to post
Share on other sites

Do you want it to be a form application? It would be much simpler to use google docs to create a form which automatically writes to a spreadsheet.

I edit my posts a lot.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, MrDrWho13 said:

Do you want it to be a form application? It would be much simpler to use google docs to create a form which automatically writes to a spreadsheet.

Yeah, I want it to be a form application, but executable as windows application. Could I maybe upload what I have now? You guys would laugh at what I made, but I tried ;/

Link to comment
Share on other sites

Link to post
Share on other sites

Why don't you search on youtube? There is plenty of tutorial video's. Also use visual studio. It is just drag n drop.

PC: Case: Cooler Master CM690 II - PSU: Cooler Master G650M - RAM: Transcend 4x 8Gb DDR3 1333Mhz - MoBo: Gigabyte Z87x-D3H - CPU: i5 4670K @ 4.5Ghz - GPU: MSI GTX1060 ARMOR OC - Hard disks: 4x 500Gb Seagate enterprise in RAID 0 - SSD: Crucial M4 128Gb

Phone: Samsung Galaxy S6

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, LUUD18 said:

Why don't you search on youtube? There is plenty of tutorial video's. Also use visual studio. It is just drag n drop.

That's what I am doing, I am using visual studio, but now the whole design of application form is gone.

Link to comment
Share on other sites

Link to post
Share on other sites

Can you put it on pastebin or something? I am not gonna download some random rar file from a stranger.

PC: Case: Cooler Master CM690 II - PSU: Cooler Master G650M - RAM: Transcend 4x 8Gb DDR3 1333Mhz - MoBo: Gigabyte Z87x-D3H - CPU: i5 4670K @ 4.5Ghz - GPU: MSI GTX1060 ARMOR OC - Hard disks: 4x 500Gb Seagate enterprise in RAID 0 - SSD: Crucial M4 128Gb

Phone: Samsung Galaxy S6

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/28/2017 at 3:53 AM, happyteddybearwithnobeard said:

Here is what I have now. Would you kindly take a look and tell me what's wrong with that?

 

https://ufile.io/18980

First, in Form1 you're missing the constructor with the call to InitializeComponent(). That's why when you run your application nothing is being displayed on the forms.

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
  
    // rest of code
}

Second, don't modify the designer file (Form1.Designer.cs) unless you need to. It's meant to hold the code that's generated from Visual Studio designer. Instead, you use the code behind file (Form1.cs - ie: the file where you put your SQL code).

 

I noticed that all your event methods were in the designer file instead of your code file. I don't know if it was something you did but I manually went through and moved the events to the code file.

 

Third, your call to Close() at the end of button4_click is closing your whole form. This may be what you want, but I just wanted to make sure.

protected void button4_Click(object sender, EventArgs e)
{
    // ...

        Close();  // This closes the windows form, not a connection or anything. In case that's what you intended.
    }
}

 

I think I've fixed up your project for you and added in some code for the sql method to hopefully get you on the right track. Here are the attached files.

VisualStudio2.zip

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, madknight3 said:

First, in Form1 you're missing the constructor with the call to InitializeComponent(). That's why when you run your application nothing is being displayed on the forms.


public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
  
    // rest of code
}

Second, don't modify the designer file (Form1.Designer.cs) unless you need to. It's meant to hold the code that's generated from Visual Studio designer. Instead, you use the code behind file (Form1.cs - ie: the file where you put your SQL code).

 

I noticed that all your event methods were in the designer file instead of your code file. I don't know if it was something you did but I manually went through and moved the events to the code file.

 

Third, your call to Close() at the end of button4_click is closing your whole form. This may be what you want, but I just wanted to make sure.


protected void button4_Click(object sender, EventArgs e)
{
    // ...

        Close();  // This closes the windows form, not a connection or anything. In case that's what you intended.
    }
}

 

I think I've fixed up your project for you and added in some code for the sql method to hopefully get you on the right track. Here are the attached files.

VisualStudio2.zip

Hello! Yes! Thanks for your help, before I saw your reply, I moved everything to visual studio 2010 and database to sql server 2008, used a YT tutorial and now everything works fine :))

Link to comment
Share on other sites

Link to post
Share on other sites

Make yourself familiarized with MySQL.  Its the most used database.

PC: Case: Cooler Master CM690 II - PSU: Cooler Master G650M - RAM: Transcend 4x 8Gb DDR3 1333Mhz - MoBo: Gigabyte Z87x-D3H - CPU: i5 4670K @ 4.5Ghz - GPU: MSI GTX1060 ARMOR OC - Hard disks: 4x 500Gb Seagate enterprise in RAID 0 - SSD: Crucial M4 128Gb

Phone: Samsung Galaxy S6

Link to comment
Share on other sites

Link to post
Share on other sites

39 minutes ago, LUUD18 said:

Make yourself familiarized with MySQL.  Its the most used database.

Thanks for the advice and your help :)

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, LUUD18 said:

Make yourself familiarized with MySQL.  Its the most used database.

I wouldn't be surprised if Microsoft's Sql Server is more common when working within the .NET ecosystem though. It certainly doesn't hurt to learn to work with MySql, but I probably wouldn't use it over Sql Server in .NET unless I had a specific reason to do so.

 

Given @happyteddybearwithnobeard is already using Sql Server in their project, there's probably no need for them to switch. But it doesn't hurt to explore your options.

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 30.03.2017 at 4:53 PM, madknight3 said:

I wouldn't be surprised if Microsoft's Sql Server is more common when working within the .NET ecosystem though. It certainly doesn't hurt to learn to work with MySql, but I probably wouldn't use it over Sql Server in .NET unless I had a specific reason to do so.

 

Given @happyteddybearwithnobeard is already using Sql Server in their project, there's probably no need for them to switch. But it doesn't hurt to explore your options.

 

Of course it doesn't hurt. Thank you for your response ???

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×