Results 1 to 9 of 9

Thread: [RESOLVED] [2008] understanding my.settings

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    170

    Resolved [RESOLVED] [2008] understanding my.settings

    I'm in the process of upgrading from vb6 to .net and still a little new to it. I've been reading up everywhere i can find on my.settings. Previously I had been using an .ini file. At run time I was able to open that file and modify it if necessary:

    Code:
    Dim theiniid As Double
    ChDir App.Path
    If Dir("myinifile.ini") <> "" Then
        theiniid = Shell("Notepad myinifile.ini", vbMaximizedFocus)
    End If
    The first thing I've been trying to resolve is that the My.settings config file gets stored several levels deep into the users documents dir. Whats the VB code to access that path since its local per user per OS?

    Secondly since the style type is changing from *.ini to *.xml ive been considering creating a form to show these items instead. XML isn't as clean to look at, a form with a listbox would be much easier on the eyes.

    Some code i've found to generate this:

    Code:
    For Each item As System.Configuration.SettingsProperty In My.Settings.Properties
        listbox1.items.additem(item.name)
    Next
    The problem with this batch of code is that item.value doesnt exist, is there a way to access that via this method?

    Another thing I've noticed is that during the inital stage of the code I declare

    Code:
    mainform.hide
    formnumber2.show
    irrigardless the primary form pops up anyways. Anyone know how to stop that?
    Thanks
    Last edited by Xilbus; Mar 26th, 2008 at 11:48 AM.
    You're the King? Well I didn't vote for you...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width