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. Adding Attributes to Control instances

Adding Attributes to Control instances

Scheduled Pinned Locked Moved Visual Basic
csharpdata-structuresquestion
3 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.
  • T Offline
    T Offline
    testy_proconsul
    wrote on last edited by
    #1

    Hello all! i want to add my custom attribute to a Control member of a form. For exmaple there is the following code line: _ Public WithEvents grdTest as DataGridView Now, at runtime, i want to read the the information of the MyAttribute instance of the grdTest-Control but when i call GetCustomAttributes of the PropertyInfo of the grdTest control instance the resulting array has zero elements ... it seems, that the changes i made in the TestForm.Designer.vb are not compiled ... has anyone any idea? :) greets testy

    solidIT.de - under construction Components for Microsoft .Net audittrail, objectcomparer, deepcopy and much more ...

    C 1 Reply Last reply
    0
    • T testy_proconsul

      Hello all! i want to add my custom attribute to a Control member of a form. For exmaple there is the following code line: _ Public WithEvents grdTest as DataGridView Now, at runtime, i want to read the the information of the MyAttribute instance of the grdTest-Control but when i call GetCustomAttributes of the PropertyInfo of the grdTest control instance the resulting array has zero elements ... it seems, that the changes i made in the TestForm.Designer.vb are not compiled ... has anyone any idea? :) greets testy

      solidIT.de - under construction Components for Microsoft .Net audittrail, objectcomparer, deepcopy and much more ...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Do attributes use < and > in VB, instead of [] ? BTW, check 'Ignore HTML tags' for those to show up in your post.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      T 1 Reply Last reply
      0
      • C Christian Graus

        Do attributes use < and > in VB, instead of [] ? BTW, check 'Ignore HTML tags' for those to show up in your post.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        T Offline
        T Offline
        testy_proconsul
        wrote on last edited by
        #3

        argh!!! :) thank you.... hmm ... yes: in VB you must use "<" and ">" and if you want to write it in multiple lines (like in C#) ... you must write an underscore... that is very "un-handy" (??) _ _ Public Sub Test() End Sub the code line looks like: Public WithEvents grdTest as DataGridView solidIT.de - under construction Components for Microsoft .Net audittrail, objectcomparer, deepcopy and much more ... -- modified at 10:47 Tuesday 27th March, 2007

        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