Click here to Skip to main content
15,923,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionToolstrip/Menustrip Pin
kenexcelon22-Feb-06 9:27
kenexcelon22-Feb-06 9:27 
AnswerRe: Toolstrip/Menustrip Pin
RichardBerry23-Feb-06 0:12
RichardBerry23-Feb-06 0:12 
QuestionWindows Application type or Console Application type? Pin
Slow Learner22-Feb-06 9:13
Slow Learner22-Feb-06 9:13 
AnswerRe: Windows Application type or Console Application type? Pin
Joshua Quick22-Feb-06 12:47
Joshua Quick22-Feb-06 12:47 
QuestionFilter data in DataGridView Pin
Brian Holdridge22-Feb-06 9:00
Brian Holdridge22-Feb-06 9:00 
AnswerRe: Filter data in DataGridView Pin
RichardBerry22-Feb-06 22:38
RichardBerry22-Feb-06 22:38 
GeneralRe: Filter data in DataGridView Pin
Brian Holdridge24-Feb-06 2:34
Brian Holdridge24-Feb-06 2:34 
QuestionPassing object from one form to another Pin
G7236022-Feb-06 8:52
G7236022-Feb-06 8:52 
Hey,

I'm a beginner in VB.NET and I'm trying to build a small application. In this application I create an object (user) on Form1 (IMSLogin). In my second form, I want to keep using the same object.

I tried to do this by coding the following:

IMSLogin is the form where the user-object is created.
<br />
Public Class IMSLogin<br />
    Inherits System.Windows.Forms.Form<br />
    Private frmMainMenu As MainMenu<br />
    Public user As New User<br />
    Me.frmMainMenu = New MainMenu(user)<br />
    Me.frmMainMenu.Show()


MainMenu is the form where I want to use the user-object that was passed by via IMSLogin. This is my coding for MainMenu:

Public Class MainMenu<br />
    Inherits System.Windows.Forms.Form<br />
<br />
    Dim user As User<br />
<br />
    Public Sub New(ByVal objUser As User)<br />
        MyBase.New()<br />
<br />
        'This call is required by the Windows Form Designer.<br />
        InitializeComponent()<br />
<br />
        Dim UserFromParent As User<br />
        UserFromParent = objUser<br />
    End Sub<br />
End Class


When I try to build my application, I get the following error:
"MainMenu" is a type in "WindowsApplication1" and cannot be used as an expression.

Can someone please help me with this? It's really urgent! Confused | :confused:

Thanks!!!!!!



G72360
AnswerRe: Passing object from one form to another Pin
Joshua Quick22-Feb-06 13:09
Joshua Quick22-Feb-06 13:09 
QuestionDatagrids and the Date....... Pin
daviiie22-Feb-06 6:34
daviiie22-Feb-06 6:34 
AnswerRe: Datagrids and the Date....... Pin
RichardBerry22-Feb-06 20:59
RichardBerry22-Feb-06 20:59 
QuestionPassing Arrays of structures from VB.NET to unmanaged C++ Pin
CPop22-Feb-06 6:17
CPop22-Feb-06 6:17 
QuestionHow to use an HttpWebClientProtocol class Pin
Hohnerman2022-Feb-06 6:03
Hohnerman2022-Feb-06 6:03 
QuestionHow do i assign variables in VB.NET? Pin
Slow Learner22-Feb-06 5:26
Slow Learner22-Feb-06 5:26 
AnswerRe: How do i assign variables in VB.NET? Pin
ToddHileHoffer22-Feb-06 5:53
ToddHileHoffer22-Feb-06 5:53 
GeneralRe: How do i assign variables in VB.NET? Pin
Slow Learner22-Feb-06 6:02
Slow Learner22-Feb-06 6:02 
GeneralRe: How do i assign variables in VB.NET? Pin
MohammadAmiry23-Feb-06 5:13
MohammadAmiry23-Feb-06 5:13 
QuestionNeed help on String manipulation Pin
Slow Learner22-Feb-06 5:20
Slow Learner22-Feb-06 5:20 
AnswerRe: Need help on String manipulation Pin
Jason McBurney22-Feb-06 5:23
Jason McBurney22-Feb-06 5:23 
GeneralRe: Need help on String manipulation Pin
Slow Learner22-Feb-06 5:37
Slow Learner22-Feb-06 5:37 
GeneralRe: Need help on String manipulation Pin
Jason McBurney22-Feb-06 5:44
Jason McBurney22-Feb-06 5:44 
GeneralRe: Need help on String manipulation Pin
Slow Learner22-Feb-06 5:52
Slow Learner22-Feb-06 5:52 
GeneralRe: Need help on String manipulation Pin
Jason McBurney22-Feb-06 6:36
Jason McBurney22-Feb-06 6:36 
GeneralRe: Need help on String manipulation Pin
Slow Learner22-Feb-06 8:14
Slow Learner22-Feb-06 8:14 
GeneralRe: Need help on String manipulation Pin
Guffa22-Feb-06 9:53
Guffa22-Feb-06 9:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.