Click here to Skip to main content
15,910,303 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: ADSL Network Connection Information Pin
FeRtoll6-Feb-07 21:05
FeRtoll6-Feb-07 21:05 
Questionif, then statement Pin
jds12076-Feb-07 10:07
jds12076-Feb-07 10:07 
AnswerRe: if, then statement Pin
nlindley76-Feb-07 10:54
nlindley76-Feb-07 10:54 
GeneralRe: if, then statement Pin
jds12077-Feb-07 2:56
jds12077-Feb-07 2:56 
GeneralRe: if, then statement Pin
nlindley77-Feb-07 3:40
nlindley77-Feb-07 3:40 
GeneralRe: if, then statement Pin
jds12077-Feb-07 5:35
jds12077-Feb-07 5:35 
GeneralRe: if, then statement Pin
jds12077-Feb-07 5:58
jds12077-Feb-07 5:58 
QuestionMy.Settings won't serialize my class Pin
TwoFaced6-Feb-07 7:52
TwoFaced6-Feb-07 7:52 
I was wondering if you can add a custom class to the My.Settings object. I mean I know you can because I did, but the problem I'm having is the class won't persist ie. the data isn't saved. The only requirment (I thought) was that the object needed to be serializable, which mine is. So am I doing something wrong, or is this just not an option. I looked for a while but just couldn't find an answer or an example. Also as a general rule, if there even is one, what kind of data should I save using the my.settings object? Should I just stick with basics like form location and color settings or is it appropriate to store whatever you want as long as you wish to store it in an xml format?

Here is a very simple class I made for testing.
<Serializable()> _
Public Class TestClass
    Public Name As String

    Public Sub New(ByVal name As String)
        Me.Name = name
    End Sub
End Class
This is the code I used to extend My.Settings object.
Namespace My
    Partial Friend NotInheritable Class MySettings
        Inherits Global.System.Configuration.ApplicationSettingsBase

        <Global.System.Configuration.UserScopedSettingAttribute(), _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         Global.System.Configuration.DefaultSettingValueAttribute(Nothing)> _
        Public Property MyTestClass() As TestClass
            Get
                Return CType(Me("MyTestClass"), TestClass)
            End Get
            Set(ByVal value As TestClass)
                Me("MyTestClass") = value
            End Set
        End Property
    End Class
End Namespace

AnswerRe: help help help!! Pin
Christian Graus6-Feb-07 9:35
protectorChristian Graus6-Feb-07 9:35 
QuestionRandom letters Pin
harveyhanson6-Feb-07 6:02
harveyhanson6-Feb-07 6:02 
AnswerRe: Random letters Pin
FeRtoll6-Feb-07 6:26
FeRtoll6-Feb-07 6:26 
GeneralRe: Random letters Pin
harveyhanson6-Feb-07 6:32
harveyhanson6-Feb-07 6:32 
AnswerRe: Random letters Pin
Are Jay6-Feb-07 6:47
Are Jay6-Feb-07 6:47 
GeneralRe: Random letters Pin
harveyhanson6-Feb-07 6:51
harveyhanson6-Feb-07 6:51 
AnswerRe: Random letters Pin
Guffa6-Feb-07 7:38
Guffa6-Feb-07 7:38 
GeneralRe: Random letters Pin
harveyhanson6-Feb-07 8:41
harveyhanson6-Feb-07 8:41 
GeneralRe: Random letters Pin
Christian Graus6-Feb-07 9:39
protectorChristian Graus6-Feb-07 9:39 
GeneralRe: Random letters Pin
Guffa6-Feb-07 10:33
Guffa6-Feb-07 10:33 
GeneralRe: Random letters [modified] Pin
TwoFaced6-Feb-07 12:17
TwoFaced6-Feb-07 12:17 
GeneralRe: Random letters Pin
harveyhanson18-Feb-07 11:40
harveyhanson18-Feb-07 11:40 
GeneralRe: Random letters Pin
TwoFaced18-Feb-07 11:47
TwoFaced18-Feb-07 11:47 
GeneralRe: Random letters Pin
harveyhanson18-Feb-07 12:01
harveyhanson18-Feb-07 12:01 
GeneralRe: Random letters Pin
TwoFaced18-Feb-07 19:28
TwoFaced18-Feb-07 19:28 
QuestionDisplay Pin
Misanthropia6-Feb-07 5:53
Misanthropia6-Feb-07 5:53 
AnswerRe: Display Pin
Christian Graus6-Feb-07 9:42
protectorChristian Graus6-Feb-07 9:42 

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.