Click here to Skip to main content
16,006,001 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: ActiveX component can't create object Pin
Nick Parker8-Aug-02 11:52
protectorNick Parker8-Aug-02 11:52 
GeneralRe: ActiveX component can't create object Pin
Anbuselvan11-Aug-02 21:55
Anbuselvan11-Aug-02 21:55 
QuestionUsing VB to access File Properties? Pin
Barleyman7-Aug-02 11:18
Barleyman7-Aug-02 11:18 
QuestionReset security permission of a child object, How ? Pin
Yoav6-Aug-02 23:30
Yoav6-Aug-02 23:30 
GeneralVisual Basic / Access Xp help Pin
hemroids6-Aug-02 3:41
hemroids6-Aug-02 3:41 
GeneralRe: Visual Basic / Access Xp help Pin
Martin Ziacek6-Aug-02 3:44
Martin Ziacek6-Aug-02 3:44 
GeneralNested Classes (after much hair pulling) Pin
Ray Cassick5-Aug-02 18:31
Ray Cassick5-Aug-02 18:31 
GeneralRe: Nested Classes (after much hair pulling) Pin
Richard Deeming5-Aug-02 22:57
mveRichard Deeming5-Aug-02 22:57 
Make the nested classes and their properties Public, but make the constructors as Friend. That way, only code within your assembly can create instances of the internal class.

You may be better off using Shared methods instead, which would remove the need to create instances of the class. For example:

Class App
    Public Class Paths
        Private Shared _Path1 as String
        Shared Sub New()
            'Initialize your properties here
        End Sub
        Private Sub New()
            'No need to create instances of this class
        End Sub

        Public Shared Readonly Property Path1 As String
            Get
                Return _Path1
            End Get
        End Property
    End Class

    Public Class Config
        Private Shared _Setting1 As String
        Shared Sub New()
            'Initialize your properties here
        End Sub
        Private Sub New()
            'No need to create instances of this class
        End Sub

        Public Shared Readonly Property Setting1 As String
            Get
                Return _Setting1
            End Get
        End Property
    End Class

    Shared Sub New()
        'Initialize any properties for App here
    End Sub
    Private Sub New()
        'No need to create instances of this class
    End Sub
End Class

Then, you can just use:
Dim Path1 As String = App.Paths.Path1


Updated: the member variables have to be Shared as well! Blush | :O
GeneralNested Classes (after much hair pulling) Pin
Ray Cassick5-Aug-02 18:28
Ray Cassick5-Aug-02 18:28 
GeneralRe: Nested Classes (after much hair pulling) Pin
Ray Cassick6-Aug-02 3:49
Ray Cassick6-Aug-02 3:49 
GeneralControl array annoyances... Pin
Ray Cassick5-Aug-02 9:55
Ray Cassick5-Aug-02 9:55 
Generalhelp needed...!!! Pin
drmzunlimited5-Aug-02 7:04
drmzunlimited5-Aug-02 7:04 
GeneralStoring input to a cell in excel Pin
skydivenut4-Aug-02 16:31
skydivenut4-Aug-02 16:31 
Generalmulti text file processing Pin
ftjjk4-Aug-02 15:51
ftjjk4-Aug-02 15:51 
GeneralError when trying Update on SQLDataAdapter Pin
Knappen4-Aug-02 5:07
Knappen4-Aug-02 5:07 
Generalupdate database in vb.net Pin
devil6663-Aug-02 11:41
devil6663-Aug-02 11:41 
GeneralRe: update database in vb.net Pin
Nick Parker7-Aug-02 2:59
protectorNick Parker7-Aug-02 2:59 
GeneralHelp!! VB.NET Custom DataGridColumn Problem ... Pin
afphinfan12-Aug-02 5:42
afphinfan12-Aug-02 5:42 
GeneralAcess Form Controls Pin
Bruno Lemos2-Aug-02 0:48
Bruno Lemos2-Aug-02 0:48 
GeneralWeb Services Implementation Guide Pin
Stanford Powers31-Jul-02 18:33
sussStanford Powers31-Jul-02 18:33 
GeneralRe: Web Services Implementation Guide Pin
Jason McBurney1-Aug-02 11:25
Jason McBurney1-Aug-02 11:25 
GeneralMDI QueryUnloads Pin
Jason McBurney31-Jul-02 5:07
Jason McBurney31-Jul-02 5:07 
GeneralRe: MDI QueryUnloads Pin
Tom Welch31-Jul-02 5:14
Tom Welch31-Jul-02 5:14 
GeneralRe: MDI QueryUnloads Pin
Colin Leitner31-Jul-02 5:17
Colin Leitner31-Jul-02 5:17 
GeneralRe: MDI QueryUnloads Pin
Roger Wright31-Jul-02 5:26
professionalRoger Wright31-Jul-02 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.