my.settings

How to access MyProject.MySettings.Default.SomeSetting from xaml?

被刻印的时光 ゝ 提交于 2019-12-24 10:35:17
问题 I have defined a StringCollection in the Project Settings. I want to use the values in a ComboBox. Is there a way to access it xamly? I tried: <CollectionViewSource Source="{x:Static src:MySettings.Default.MyCollection}" /> <CollectionViewSource Source="{Binding Source={x:Static src:MySettings.Default.MyCollection}}" /> ****src** is the xmlns of the project* It says: "Type src:MySettings.Default was not found". The thing is that MySettings is a class that offers a Default property which is a

Adding Editor / EditorAttribute at Run-time (Dynamically) to an Object's Property

纵饮孤独 提交于 2019-12-23 12:37:34
问题 How to add the EditorAttribute (Editor) to an object's property at run-time? I have My.Settings.ExcludeFiles , which is created by the settings designer as Public Property ExcludedFiles() As Global.System.Collections.Specialized.StringCollection . When editing ExcludedFiles via a property grid, the "String Collection Editor" generates a "Constructor on type 'System.String' not found" run-time exception. I cannot change the attributes of the ExcludeFiles property because they will be

Define a custom path where the user.config file should be saved?

。_饼干妹妹 提交于 2019-12-22 03:50:36
问题 If I rename my compiled application for example from myapp.exe to app.exe then when I run the renamed executable a new user settings folder is generated in this path: C:\Users\{User}\AppData\Local\{CompanyName}\{ExecutableName}_Url_{SystemGUID or something strange} So I loose all the saved settings. Then how I could solve this problem defining in a VBNET WinForms my own location to store the user.config file, or any other solution using the applicationsettings infrastructure ? (not saving the

How to save a Forms Background Image using My.Settings.Save Visual Basic

a 夏天 提交于 2019-12-19 12:22:14
问题 I'm trying to make an Operating System in Visual Basic (program based of course) and it needs personalisation. I want the user to be able to choose from a select group of images, stored in the Resources of the project, and I want that image to be saved, so that the next time they log on to the software, the form has the same image they selected saved. Extra Information: The image selection is on a seperate form. Using: If ComboBox1.Text = "Beach Fade" Then PictureBox1.BackgroundImage = My

How to change application config file name (AppName.exe.config)?

倖福魔咒の 提交于 2019-12-11 07:36:01
问题 I use My.Settings object in VB.NET, which automatically gets application setting from AppName.exe.config file. How can I store config in file with other name, not AppName.exe.config? I have several programs, all of them now uses their own .config file, but in fact they all are clones, and if I change some setting I need to edit several configs. 回答1: This will work with <appSettings> , not sure if it works with the Settings Design time Put the app.config file in the solution folder so one

my.settings and descriptions? And getting them into a propertygrid?

送分小仙女□ 提交于 2019-12-11 02:45:48
问题 I recently learned of the propertygrid object usage with the my.settings object for a project. I like this very much and I was wondering if there is a way to include descriptions with my settings so that they will be included in the propertygrid in the lower description panel? I found a couple of old (2003) codeproj articles that covers this but it requires a lot of custom work and was hoping that there has been an easier method to come around. 回答1: This is very simple to do and doesn't

Define a custom path where the user.config file should be saved?

情到浓时终转凉″ 提交于 2019-12-05 01:47:18
If I rename my compiled application for example from myapp.exe to app.exe then when I run the renamed executable a new user settings folder is generated in this path: C:\Users\{User}\AppData\Local\{CompanyName}\{ExecutableName}_Url_{SystemGUID or something strange} So I loose all the saved settings. Then how I could solve this problem defining in a VBNET WinForms my own location to store the user.config file, or any other solution using the applicationsettings infrastructure ? (not saving the settings on the registry or other things) PS: I've read this SO post which is a little bit different

My.Settings does not save an ArrayList

若如初见. 提交于 2019-11-29 16:10:30
I've set this emptyness property: But after assigning a new ArrayList object to the property, the property always still empty in every application execution. In a handler of MyBase.Load event I do a call to this method, just for testing this issue: sub blahblah handles mybase.load me.CheckRecentFiles end sub Private Sub CheckRecentFiles() Try ' This throws an object not referenced exception 'cause always is empty. MsgBox(My.Settings.RecentFiles.Count) Catch ex As Exception MsgBox(ex.Message) End Try ' Just for testing, if the collection is empty then I instance a new ArrayList ' and I assign

Run child process non-elevated from an elevated/As Admin process

半世苍凉 提交于 2019-11-29 12:50:14
My application has a built-in self update system via another app called "updater.exe" which is in the same folder with the main application to update. It downloads the newest version, terminates the old one (if it's running) and then overwrites it. The problem is, to do that the updater.exe must be run with the Administrator privileges in order to have access to C:\Program Files\MyApp So far so good, the main app runs the updater.exe with Admin privileges (using UAC) but then the problem appears: After update is completed, I want the new installed version to start automatically. Guess what? Of

My.Settings does not save an ArrayList

柔情痞子 提交于 2019-11-28 09:26:34
问题 I've set this emptyness property: But after assigning a new ArrayList object to the property, the property always still empty in every application execution. In a handler of MyBase.Load event I do a call to this method, just for testing this issue: sub blahblah handles mybase.load me.CheckRecentFiles end sub Private Sub CheckRecentFiles() Try ' This throws an object not referenced exception 'cause always is empty. MsgBox(My.Settings.RecentFiles.Count) Catch ex As Exception MsgBox(ex.Message)