• Welcome to Valhalla Legends Archive.
 

VB.Net Menu Help (Solved)

Started by Antichrist, August 24, 2004, 04:58 PM

Previous topic - Next topic

Antichrist

I've got my menu completed, and now I'm working on the code. I've tried many things, and I'm not exactly sure what to do. I'm trying to simply get it so when you go to Help | About, the About window shows.. My About window is named frmAbout.vb I've tried Show(frmAbout) but it wants me to declare frmAbout, i declared it as a String, and it tells me "To many arguements to "Public Sub Show()" and i made it Private Sub, so idk where the Public Sub comes from. I admit I'm a newbie, and I probably shouldnt even be trying to make a bot yet, but I'm trying to learn as I go.

UserLoser.

Note the name of this forum is Battle.net Bot Development.  Not .NET Platform.  And if you're a newbie, I'd suggest not writing a Battle.net binary bot.

MyndFyre

Quote from: Antichrist on August 24, 2004, 04:58 PM
I've got my menu completed, and now I'm working on the code. I've tried many things, and I'm not exactly sure what to do. I'm trying to simply get it so when you go to Help | About, the About window shows.. My About window is named frmAbout.vb I've tried Show(frmAbout) but it wants me to declare frmAbout, i declared it as a String, and it tells me "To many arguements to "Public Sub Show()" and i made it Private Sub, so idk where the Public Sub comes from. I admit I'm a newbie, and I probably shouldnt even be trying to make a bot yet, but I'm trying to learn as I go.

This thread ought to be moved to the .NET Platform Forum.
[
Antichrist, if you're familiar with VB, you'll find a lot of things are different in VB .NET.  I suggest that you learn that first.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

hismajesty

That's becuase you can't reference it directly. Take for example this code:


Dim aShow As New frmAbout
aShow.Show()


Or, if you're using the 2005 beta, you can just do this.
My.Forms.frmAbout.Show()


Antichrist

oh yes, i keep forgeting about the .net platform forum, im sorry. thanks for the help, ill prolly learn more before i continue.

hismajesty

Quote from: Antichrist on August 24, 2004, 05:17 PM
oh yes, i keep forgeting about the .net platform forum, im sorry. thanks for the help, ill prolly learn more before i continue.

So, it's working now?

Antichrist

#6
Quote from: hismajesty[yL] on August 24, 2004, 08:12 PM
So, it's working now?

No it's not. My About form is called: About.vb
I took your code and put this:


Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
       Dim aShow As New About
       aShow.Show()
   End Sub


and it says Type 'About' is not defined. By the way. I'm using Version 2003.

Banana fanna fo fanna

Alright, let's try figuring this out on our own, shall we?

Look at the error message. It doesn't know what the name "About" means. This means:

- You spelled it wrong somewhere
- It's not in the current namespace

How do we bring something into the current namespace? I think, in vb.net, it's Imports.

There are your hints.

MyndFyre

Or maybe by using the correct identifier...
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Antichrist

Ah! In the Solution Explorer it was reading as 'About' but I went into the Class View, and it was Form3. I tried it out just to see what would happen, and now it works beautifully. For future use to all those with the same problem this is what I have:


Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
       Dim About As New Form3
       About.Show()
   End Sub

MyndFyre

Quote from: Antichrist on August 26, 2004, 11:44 AM
Ah! In the Solution Explorer it was reading as 'About' but I went into the Class View, and it was Form3. I tried it out just to see what would happen, and now it works beautifully. For future use to all those with the same problem this is what I have:

Yes, forms are not necessarily the same name as the file.  Within the file is a declaration "Public Class Form3 Inherits System.Windows.Forms.Form".  The term Form3 (or something similar) is the identifier of the form, not the name of the file that contains it.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.