Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Intellisense not listing components

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    40

    Resolved [RESOLVED] [2005] Intellisense not listing components

    I'm attempting to reference controls on one form from another. For example, depending on certain conditions I might want to show hidden controls on form A when opening from form B. I have done this sucessfully several times in my application.

    But now, when I try accessing the control, the error: 'dtpAddyEnd' is not a member of 'System.Windows.Forms.Form' displays.

    The controls are accessible in form A's .vb code without issue.

    The code snippet from form B is:
    Code:
                    Dim frm as Form
                            frm = New frmClientAddyAdd
                            frm.dtpAddyEnd.visible = True
                            frm.ShowDialog()
    which is identical to code in forms that work.

    I've looked in form A's Designer code to see if anything looked out of place, but was unable to see a problem.

    I've tried cleaning the code and rebuilding. I closed out of VS and reopened, but all to no avail.

    Any suggestions?
    Vic

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] Intellisense not listing components

    that's because frm is dimmed as a form.... not frmClientAddyAdd .... if you change it from
    Code:
    Dim frm As Form
    to
    Code:
    Dim frm As frmClientAddyAdd
    you might find you get the intellisense you expect.

    To further it.... the intellisense is based on the TYPE of the variable.... not what it actually gets set to.... which is how you were expecting it to work.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    40

    Re: [2005] Intellisense not listing components

    I changed the Dim statement to:
    Dim frm As New frmClient AddyAdd

    and the code was recognized.

    Don't understand the distinction. But at least I got it to work.

    Vic

  4. #4
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: [2005] Intellisense not listing components

    Quote Originally Posted by veepm

    Don't understand the distinction. But at least I got it to work.

    Vic
    The distinction is quite simple. The intellisense is based of of what you declare the variable to be. A Form variable does not have a property called dtpAddyEnd, so it doesn't show up. A frmClientAddyAdd does have a variable called dtpAddyEnd, so it shows up.
    (VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] [2005] Intellisense not listing components

    Form is the base, generic data type.... it's like saying something is a "number" ... doesn't mean much.... number could mean anything including 2.1. But if some thing was declared as an Integer.... well, then 2.1 o longer becomes a valid value. Samething happens when something is declared as a "Form" ... ti could be any kind of form.. a login form, a dialog form, your main form... some other form.... so intellisense has no way of knowing what controls are available on the "form" because it doesn't know WHAT form you're talking about. by diming it as a specific form type, well, now you've narrowed it down to a specific form type. And from THAT the IDE can figure out what's available.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width