[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

problem passing values from called form, VB.Net VSS 2003

Posted on 2007-08-08
6
Medium Priority
?
195 Views
Last Modified: 2010-04-23
in VB.Net (VSS 2003)

I have a main form and it calls another form like this:

dim f as new frmNI
f.ShowDialog
if f.ErrCode = 0 then
     Me.cboPMItem.Items.Add(f.PMItem)
End If
f.close

In frmNI I have this:
    Private m_VendItem As String
    Private m_ErrCode As Integer
    Private m_ErrDesc As String
    Private m_ItemCode As String
    Private m_ItemDesc As String
    Private m_ATAQE As String

    WriteOnly Property VendItem()
        Set(ByVal Value)
            m_VendItem = Value
        End Set
    End Property
    ReadOnly Property ErrCode()
        Get
            Return m_ErrCode
        End Get
    End Property
    ReadOnly Property ErrDesc()
        Get
            Return m_ErrDesc
        End Get
    End Property
    ReadOnly Property PMItem()
        Get
            Return m_ItemCode
        End Get
    End Property
    ReadOnly Property IDesc()
        Get
            Return m_ItemDesc
        End Get
    End Property
    ReadOnly Property ATAQE()
        Get
            Return m_ATAQE
        End Get
    End Property

and of course some routines that set the values for the memory variables, e.g.,

m_ItemCode = "12345"

My problem is that in the calling program intellisense doesn't work for any of the variables.

For example, if I type in the calling program          me.txtAnything = f.PMItem.   the only thing that shows in intellisense is "GetValue" -- why don't I see things like ToString,PadRight, etc -- why does it not know that it's a string or whatever?

Thanks

0
Comment
Question by:g_johnson
  • 3
  • 2
6 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 1200 total points
ID: 19655252
Unless you type your properties, you won't get intellisense.


ReadOnly Property PMItem()
    Get
        Return m_ItemCode
    End Get
End Property

Needs to be:

ReadOnly Property PMItem() As String
    Get
        Return m_ItemCode
    End Get
End Property

You can enforce this by putting Option Strict On at the top of your form... Then you will have a compile error for each property left untyped.
0
 
LVL 7

Assisted Solution

by:dctuck
dctuck earned 800 total points
ID: 19655263
It's because you haven't specified a type for each of your properties - you need to specify whether they are strings, integers etc. e.g.:

    WriteOnly Property VendItem() As String
        Set(ByVal Value)
            m_VendItem = Value
        End Set
    End Property
    ReadOnly Property ErrCode() As Integer
        Get
            Return m_ErrCode
        End Get
    End Property
0
 
LVL 7

Expert Comment

by:dctuck
ID: 19655265
You just beat me to it :)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 38

Expert Comment

by:PaulHews
ID: 19655267
While you're at it, you might want to declare the scope of your properties, Public, Friend, etc.:

Public ReadOnly Property PMItem() As String
    Get
        Return m_ItemCode
    End Get
End Property
0
 
LVL 4

Author Comment

by:g_johnson
ID: 19655300
duh!  And the sad thing is I knew that!  I've been out of VB.Net for so long I forgot.

Thanks
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 19655379
> And the sad thing is I knew that!  I've been out of VB.Net for so long I forgot.

Sometimes it just takes another pair of eyes on something to spot the obvious.  :)  Cheers.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month18 days, 15 hours left to enroll

834 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