Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to set text property of a ComponentControl

How to set text property of a ComponentControl

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    popalzai
    wrote on last edited by
    #1

    Hi! i have made a component control and its inherited from System.Windows.Forms.Button class. now when i go to the designer and set the text property, i am unable to set the text property. when i set the text property and use this control on the form, that text setting is not coming. please let me know how can i get this resolution. Thanks!

    D 1 Reply Last reply
    0
    • P popalzai

      Hi! i have made a component control and its inherited from System.Windows.Forms.Button class. now when i go to the designer and set the text property, i am unable to set the text property. when i set the text property and use this control on the form, that text setting is not coming. please let me know how can i get this resolution. Thanks!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Without seeing your code, it's impossible to say what you did wrong.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Without seeing your code, it's impossible to say what you did wrong.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        P Offline
        P Offline
        popalzai
        wrote on last edited by
        #3

        i did not code anything. i have just created a component class and then went to designer partial class code and inherits it from the button class. that's it and then went to designer and tried to set the property from the property window.

        D 1 Reply Last reply
        0
        • P popalzai

          i did not code anything. i have just created a component class and then went to designer partial class code and inherits it from the button class. that's it and then went to designer and tried to set the property from the property window.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          How about this. Scrap the component you have and just add a new Class file to the project. Open that file up and replace anything you see in it with this:

          Public Class MyButton
              Inherits System.Windows.Forms.Button
          
              End Class
          

          Compile that, then drag one of these from the ToolBox to your form, then try and set the Text property.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          P 1 Reply Last reply
          0
          • D Dave Kreskowiak

            How about this. Scrap the component you have and just add a new Class file to the project. Open that file up and replace anything you see in it with this:

            Public Class MyButton
                Inherits System.Windows.Forms.Button
            
                End Class
            

            Compile that, then drag one of these from the ToolBox to your form, then try and set the Text property.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            P Offline
            P Offline
            popalzai
            wrote on last edited by
            #5

            hm that the way i have done too. the name of the control was "ASKButton" i have set the text property to "Add" then compile the project and drag drop the button control on the form and what i see is that the button text property is "ASkButton1". i want to set the default value for this button. when ever i drag and drop this button it should show me the Text=Add and when i want to change it, it should allow me to do so!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups