Results 1 to 5 of 5

Thread: [2005] Custom Component Property Default

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    [2005] Custom Component Property Default

    I created a version of the standard TextBox that adds an IsValid property. When I started using this control in my project, I had IsValid initially set to False inside my component. Now, I want to have it initially set to true. I made the changes to the component and recompiled the code. Everywhere I already have this control, it still remembers this default value since it is in the .Designer file.

    How do I get this to update when I make a change? Surely, I don't have to manually do this.

    Code:
        <System.ComponentModel.Browsable(False)> _
        Property IsValid() As Boolean
            Get
                Return _IsValid
            End Get
            Set(ByVal value As Boolean)
                _IsValid = value
            End Set
        End Property
    Last edited by Aspnot; Sep 6th, 2007 at 12:41 PM.
    My.Settings.Signature = String.Empty

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: [2005] Custom Component Property Default

    If you are saying that you have already dropped a control, say, on to a form and set it's properties; then, yes you'd have to go back a reset the properties of each control on the form.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: [2005] Custom Component Property Default

    Ouch. That's what I was affraid of.
    My.Settings.Signature = String.Empty

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2005] Custom Component Property Default

    Did you replace the control on the forms with the new compiled version ? When you drop the new version on your forms it should automatically regenerate new designer code and if your new control has the default as false then thats what will be set.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: [2005] Custom Component Property Default

    Remember these two things:

    1. Each instance of a control that is dropped on the form becomes it's own instance of the class that created it -- once you modify it, it becomes unique.

    2. Would you like it if Micorsoft suddenly changed the default backcolor of a button to black and then sent out the new dll and suddenly every project you had ever built had it's buttons turn black?
    You wouldn't expect that -- so that's not how it works...Thankfully.

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