Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: TV ENUMS in a PropertyGrid  (Read 564 times)
serial
Customers
Community Member
*****
Posts: 299


« on: May 25, 2008, 12:04:18 AM »

I thought ENUMS would automatically show up in a property grid. 

Code:
Imports TV3D65
Imports System.ComponentModel

Public Class SceneProp

    Dim scene As TVScene




    Sub New()

        scene = New TVScene


    End Sub

    Property RenderMode() As TV3D65.CONST_TV_RENDERMODE
        Get
            Return 0
        End Get
        Set(ByVal value As TV3D65.CONST_TV_RENDERMODE)

            scene.SetRenderMode(value)


        End Set
    End Property



End Class
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2588


WWW
« Reply #1 on: May 25, 2008, 01:00:16 AM »

Isn't the default scope for a property "Private"? Try making it Public...
Logged

zaknafein.
>> the instruction limit : my blog & samples repository! <<
serial
Customers
Community Member
*****
Posts: 299


« Reply #2 on: May 25, 2008, 06:53:33 AM »

Thanks Zak...

That wasn't exactly it but it did help me find my problem.

I had

PropertyGrid1.SelectedObject = sceneprop

Inside of my do loop. Which means it was setting the propertygrid to my sceneprop object every loop.  This reminded me that the Propertygrid control acts funny when you do that.  Like essentially it never has time to populate the drop down boxes.
Logged
Shadowsong
Customers
Community Member
*****
Posts: 130


« Reply #3 on: June 13, 2008, 12:27:14 AM »

Code:
Property RenderMode() As TV3D65.CONST_TV_RENDERMODE
        Get
            Return 0
        End Get

That's weird! Why are you just returning 0 ??
If you don't want a Get-Method then just declare it as "WriteOnly":

Code:
WriteOnly Property RenderMode() As TV3D65.CONST_TV_RENDERMODE
        Set(ByVal value As TV3D65.CONST_TV_RENDERMODE)
            scene.SetRenderMode(value)
        End Set
 End Property
Logged
jviper
Community Member
*
Posts: 1251

Discipline in training


« Reply #4 on: June 13, 2008, 09:42:10 AM »

Problebly has to do that because Scene has a SetRenderMode but no GetRenderMode (don't know why). For there to be a Get, you'll have to keep track of cstRenderMode yourself. Personally, I hate write-only methods.
Logged

JAbstract.....Don't just imagine, make it happen!
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks