Jump to content

So I've made a little notepad program in Visual Studio Express 2012, but for my menu strip, there's an "about" option that I want to have set to open an about dialog popup upon clicking it. Kind of like the "about notepad" option in the Windows notepad. So, is there some kind of code I can use to get a custom dialog in there with my info?

 

EDIT: I'd also like to get a confirmation dialog when it closes so that it doesn't just delete whatever you typed without you being positive that you're closing the window.

Main rig on profile

VAULT - File Server

Spoiler

Intel Core i5 11400 w/ Shadow Rock LP, 2x16GB SP GAMING 3200MHz CL16, ASUS PRIME Z590-A, 2x LSI 9211-8i, Fractal Define 7, 256GB Team MP33, 3x 6TB WD Red Pro (general storage), 5x 8TB WD White Label/Red (Plex) (both arrays in their respective Windows Parity storage spaces), 1TB Teamgroup MP33 (dumping ground) Corsair RM750x, TrueNAS Scale

Sleeper HP Pavilion A6137C

Spoiler

Intel Core i7 6700K @ 4.4GHz, 4x8GB G.SKILL Ares 1800MHz CL10, ASUS Z170M-E D3, 128GB Team MP33, 1TB Seagate Barracuda, MSI GTX 970 100ME, EVGA 650G1, Windows 11 Pro

OptiPlex 7040M

Spoiler

Intel Core i7 6700, 2x16GB Mushkin Redline (stuck at 2133MHz CL13), 240GB Corsair MP510, 2TB Seagate Barracuda 2.5", 130w Dell power brick, Windows 11 Pro

Mac Mini (Late 2020)

Spoiler

Apple M1, 8GB RAM, 256GB, macOS Sonoma

Consoles: Steam Deck LCD (512GB), Softmodded 1.4 Xbox w/ 500GB HDD, Xbox 360 Elite 120GB Falcon, XB1X w/2TB MX500, Xbox Series X, PS1 1001, PS2 Slim 70000 w/ FreeMcBoot, PS4 Pro 7015B 1TB, PS5 Digital, Nintendo Switch OLED, Nintendo Wii RVL-001 (black)

Link to comment
https://linustechtips.com/topic/385147-make-about-dialog-vse-2012/
Share on other sites

Link to post
Share on other sites

The editor you're using isn't important. What is important is the language and project you're using. Visual Studio supports many different project types and programming languages so we can't give you any specifics without more information.

 

C#? VB.NET? WinForms? WPF? Something else?

Link to post
Share on other sites

There are many different ways to go about getting this done but i think one of the easiest ways for you would be to create the popup about box in Access as i am sure you already have Access and copy the VB.Net code as it would be accurate.

 

Another easy way would be to use a VB.Net code generator. Check this one out, it is free.

A water-cooled mid-tier gaming PC.

Link to post
Share on other sites

The editor you're using isn't important. What is important is the language and project you're using. Visual Studio supports many different project types and programming languages so we can't give you any specifics without more information.

 

C#? VB.NET? WinForms? WPF? Something else?

Heh, my less-than-1-hour-of-time with the program has shown through. :D

 

Apparently I used "Windows Forms Application" for it.

Main rig on profile

VAULT - File Server

Spoiler

Intel Core i5 11400 w/ Shadow Rock LP, 2x16GB SP GAMING 3200MHz CL16, ASUS PRIME Z590-A, 2x LSI 9211-8i, Fractal Define 7, 256GB Team MP33, 3x 6TB WD Red Pro (general storage), 5x 8TB WD White Label/Red (Plex) (both arrays in their respective Windows Parity storage spaces), 1TB Teamgroup MP33 (dumping ground) Corsair RM750x, TrueNAS Scale

Sleeper HP Pavilion A6137C

Spoiler

Intel Core i7 6700K @ 4.4GHz, 4x8GB G.SKILL Ares 1800MHz CL10, ASUS Z170M-E D3, 128GB Team MP33, 1TB Seagate Barracuda, MSI GTX 970 100ME, EVGA 650G1, Windows 11 Pro

OptiPlex 7040M

Spoiler

Intel Core i7 6700, 2x16GB Mushkin Redline (stuck at 2133MHz CL13), 240GB Corsair MP510, 2TB Seagate Barracuda 2.5", 130w Dell power brick, Windows 11 Pro

Mac Mini (Late 2020)

Spoiler

Apple M1, 8GB RAM, 256GB, macOS Sonoma

Consoles: Steam Deck LCD (512GB), Softmodded 1.4 Xbox w/ 500GB HDD, Xbox 360 Elite 120GB Falcon, XB1X w/2TB MX500, Xbox Series X, PS1 1001, PS2 Slim 70000 w/ FreeMcBoot, PS4 Pro 7015B 1TB, PS5 Digital, Nintendo Switch OLED, Nintendo Wii RVL-001 (black)

Link to post
Share on other sites

C++, C# or Visual Basic?

Visual Basic.

Main rig on profile

VAULT - File Server

Spoiler

Intel Core i5 11400 w/ Shadow Rock LP, 2x16GB SP GAMING 3200MHz CL16, ASUS PRIME Z590-A, 2x LSI 9211-8i, Fractal Define 7, 256GB Team MP33, 3x 6TB WD Red Pro (general storage), 5x 8TB WD White Label/Red (Plex) (both arrays in their respective Windows Parity storage spaces), 1TB Teamgroup MP33 (dumping ground) Corsair RM750x, TrueNAS Scale

Sleeper HP Pavilion A6137C

Spoiler

Intel Core i7 6700K @ 4.4GHz, 4x8GB G.SKILL Ares 1800MHz CL10, ASUS Z170M-E D3, 128GB Team MP33, 1TB Seagate Barracuda, MSI GTX 970 100ME, EVGA 650G1, Windows 11 Pro

OptiPlex 7040M

Spoiler

Intel Core i7 6700, 2x16GB Mushkin Redline (stuck at 2133MHz CL13), 240GB Corsair MP510, 2TB Seagate Barracuda 2.5", 130w Dell power brick, Windows 11 Pro

Mac Mini (Late 2020)

Spoiler

Apple M1, 8GB RAM, 256GB, macOS Sonoma

Consoles: Steam Deck LCD (512GB), Softmodded 1.4 Xbox w/ 500GB HDD, Xbox 360 Elite 120GB Falcon, XB1X w/2TB MX500, Xbox Series X, PS1 1001, PS2 Slim 70000 w/ FreeMcBoot, PS4 Pro 7015B 1TB, PS5 Digital, Nintendo Switch OLED, Nintendo Wii RVL-001 (black)

Link to post
Share on other sites

Heh, my less-than-1-hour-of-time with the program has shown through. :D

 

No worries. For future reference when asking for help, you'll want to let people know you're using Visual Basic and WinForms. Don't worry about telling people you use Visual Studio (it'll be assumed anyway).

 

For an "About" window you can simply add another Form to your project. Add labels and such to make it look like how you want it, then have your main Form open it up when the user clicks the option.

 

Here's an example method that will create and open a new form.

Public Sub OpenAbout()    Dim about As New Form2()    about.Show()End Sub

To add a confirmation box on closing, you'll want to use the FormClosing event. You can use the event args Cancel property to stop it. Here's an example.

Public Class Form1    Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing        Dim window = MessageBox.Show("Are you sure you want to close?", "Confirm", MessageBoxButtons.YesNo)        If window = DialogResult.No Then            e.Cancel = True        End If    End SubEnd Form
Link to post
Share on other sites

 

No worries. For future reference when asking for help, you'll want to let people know you're using Visual Basic and WinForms. Don't worry about telling people you use Visual Studio (it'll be assumed anyway).

 

For an "About" window you can simply add another Form to your project. Add labels and such to make it look like how you want it, then have your main Form open it up when the user clicks the option.

 

Here's an example method that will create and open a new form.

Public Sub OpenAbout()    Dim about As New Form2()    about.Show()End Sub

To add a confirmation box on closing, you'll want to use the FormClosing event. You can use the event args Cancel property to stop it. Here's an example.

Public Class Form1    Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing        Dim window = MessageBox.Show("Are you sure you want to close?", "Confirm", MessageBoxButtons.YesNo)        If window = DialogResult.No Then            e.Cancel = True        End If    End SubEnd Form

Do I more or less tack these one right before "End Class"? Again, complete n00b for this.

Main rig on profile

VAULT - File Server

Spoiler

Intel Core i5 11400 w/ Shadow Rock LP, 2x16GB SP GAMING 3200MHz CL16, ASUS PRIME Z590-A, 2x LSI 9211-8i, Fractal Define 7, 256GB Team MP33, 3x 6TB WD Red Pro (general storage), 5x 8TB WD White Label/Red (Plex) (both arrays in their respective Windows Parity storage spaces), 1TB Teamgroup MP33 (dumping ground) Corsair RM750x, TrueNAS Scale

Sleeper HP Pavilion A6137C

Spoiler

Intel Core i7 6700K @ 4.4GHz, 4x8GB G.SKILL Ares 1800MHz CL10, ASUS Z170M-E D3, 128GB Team MP33, 1TB Seagate Barracuda, MSI GTX 970 100ME, EVGA 650G1, Windows 11 Pro

OptiPlex 7040M

Spoiler

Intel Core i7 6700, 2x16GB Mushkin Redline (stuck at 2133MHz CL13), 240GB Corsair MP510, 2TB Seagate Barracuda 2.5", 130w Dell power brick, Windows 11 Pro

Mac Mini (Late 2020)

Spoiler

Apple M1, 8GB RAM, 256GB, macOS Sonoma

Consoles: Steam Deck LCD (512GB), Softmodded 1.4 Xbox w/ 500GB HDD, Xbox 360 Elite 120GB Falcon, XB1X w/2TB MX500, Xbox Series X, PS1 1001, PS2 Slim 70000 w/ FreeMcBoot, PS4 Pro 7015B 1TB, PS5 Digital, Nintendo Switch OLED, Nintendo Wii RVL-001 (black)

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

×