[Last Call] Learn how to a build a cloud-first strategyRegister Now



Posted on 2006-05-10
Medium Priority
Last Modified: 2007-12-19
I would like to create a button so that when you click it you see
this MessageBox.Show(GetVolumeSerialNumber("C:\"))
how can I do that ?
Question by:aplelois
  • 2
LVL 20

Assisted Solution

ElrondCT earned 1000 total points
ID: 16653108
Do you mean you want a MessageBox to display when you click a button, or you want the text on the button itself to have the results of your function?  In either case, you'd put the code in the button's Click event, such as:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Text = GetVolumeSerialNumber("C:\")
    End Sub

The click event subroutine is the one created when you double-click a button that's on the design surface of a form.

Author Comment

ID: 16653135
Error      1      Name 'GetVolumeSerialNumber' is not declared.

Accepted Solution

sk33v3 earned 1000 total points
ID: 16654670
I believe this is what you are looking for.

LVL 20

Expert Comment

ID: 16657501
Perhaps I misunderstood. I thought from this and your other message that you already had the function created to get a volume serial number. If you don't have that function, then sk33v3's link is what you need; download the code from there. If you have the function in your program, and you're getting the error above, then I think you need to explain a bit more what's going on (show us the code where you're getting the error).

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question