Valhalla Legends Forums Archive | .NET Platform | VB.Net Menu Help (Solved)

AuthorMessageTime
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.
August 24, 2004, 9:58 PM
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.
August 24, 2004, 10:03 PM
Myndfyr
[quote author=Antichrist link=board=17;threadid=8354;start=0#msg77198 date=1093384717]
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.
[/quote]

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.
August 24, 2004, 10:10 PM
hismajesty
That's becuase you can't reference it directly. Take for example this code:

[code]
Dim aShow As New frmAbout
aShow.Show()
[/code]

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

August 24, 2004, 10:15 PM
Antichrist
oh yes, i keep forgeting about the .net platform forum, im sorry. thanks for the help, ill prolly learn more before i continue.
August 24, 2004, 10:17 PM
hismajesty
[quote author=Antichrist link=board=37;threadid=8354;start=0#msg77206 date=1093385843]
oh yes, i keep forgeting about the .net platform forum, im sorry. thanks for the help, ill prolly learn more before i continue.
[/quote]

So, it's working now?
August 25, 2004, 1:12 AM
Antichrist
[quote author=hismajesty[yL] link=board=37;threadid=8354;start=0#msg77226 date=1093396373]
So, it's working now?
[/quote]

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

[code]
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[/code]

and it says Type 'About' is not defined. By the way. I'm using Version 2003.
August 25, 2004, 9:00 PM
St0rm.iD
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.
August 25, 2004, 9:30 PM
Myndfyr
Or maybe by using the correct identifier...
August 25, 2004, 9:50 PM
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:

[code]
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
[/code]
August 26, 2004, 4:44 PM
Myndfyr
[quote author=Antichrist link=board=37;threadid=8354;start=0#msg77408 date=1093538698]
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:
[/quote]

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.
August 26, 2004, 5:51 PM

Search