Reset My.Settings At Run Time To Initial Default Values?
Jul 12, 2009
How do I reset My.Settings at run time to the initial default values. I want to do this after the app has been running and the user may have save changed settings. The intention is to reset evering to 'factory defaults' as opposed to the last saved value as done by 'settings.reload'.For example in the property below , I want to restore to the value to '90' as given in the default value. I want to do this for all settings.[code]...
View 4 Replies
ADVERTISEMENT
Nov 23, 2010
A Windows service written in VB.NET is using the My.Settings namespace for simplicity. There are only three settings to read, and these are read within the constructor of the ServiceLauncher.
I am attempting to install the service as such:
installutil GID.ServiceLauncher.exe
And this is successful, however the config settings it is using are not the ones within the GID.ServiceLauncher.exe.config file, instead it is using the ones baked into the app as Default Settings within Settings.Designer.vb (marked with DefaultSettingValueAttribute). [The questionable wisdom of Microsoft not allowing a developer to ignore default settings is another question entirely].
How can I further diagnose this issue, and maybe force a reload of settings? I tried calling My.Settings.Default.Reload, however this did nothing. All settings are application settings, and only differ by "value" from those in the auto generated file.
I have successfully attached the debugger using System.Diagnostics.Debugger.Launch() and true enough, the settings are still the default settings.
In anticipation of the question, the background: The reason for requiring configuration settings is because this is a very straightforward service that simply executes an exe; and this exe is in configurable location. There are other reasons also, such as I wish to have the service name configurable without recompiling.
View 3 Replies
Jun 29, 2010
how to reset user settings in My.Settings to the default value, because when i checked if the user settings works i have altered the settings so now i want the settings to go back to default, because i am going to distribute the software.
View 1 Replies
Feb 3, 2010
how I can set the initial settings that will be deployed with an installation CD to my clients. I found out how the .config file is stored on my own computer when adding Userscope-settings in my project. I also read that the my.settings are also stored in app.config from where it is read when program runs first time on my clients computer and these are then stored in user.config file. Is that right?
Q: If I make an installation disk and want to have my program to have specific settings on my clients computer when he installs it does these settings follow the settings I have on my computer when I make the Installation file or can I manage these settings some way?
View 2 Replies
Dec 3, 2011
I need to print the contents of 3 textboxs to default printer. what examples I have found dont seem to work. I was trying the documentprint1 component as i thought it would be easy but cant figure out how to tell it what to print the second part is to print a variable (string) to the printer as well.no need for user to select just straight to default printer with its default settings
View 1 Replies
Jan 19, 2010
I need code for reseting form settings for my project.It had 5 comboboxes and 5 buttons.When selecting colors on comboboxes, buttons go that color.And does the calculation for the resistance measure( shown in code ).I just need something to when pressing reset button reset those form settings.Becouse the integer numbers of the buttons stay in system, and choosing new colors wont give same result.So, here's the code for more obvius lookup:
Public Class Otpor
Dim prvo As New List(Of String)
Dim Četvrto As New List(Of String)
[code].....
View 8 Replies
Apr 7, 2011
Why my database always reset and what i had enter to the database using my application will be erased.if i dont close the application. the data will stay.
View 3 Replies
Sep 22, 2011
In the following code I have two class scoped variables intCompanyID and intEmployeeID. When I set them to a value in btnFetch_Click then try to read them later in btnSubmit_Click they are set to zero.
Option Explicit On
Imports MySql.Data.MySqlClient
Imports System.Data
[code]....
View 2 Replies
Oct 14, 2010
Everytime I increase the version on my application the settings seem to reset. Is there a way for the application to keep using the same settings file no matter how many times increase the version?
View 1 Replies
Sep 13, 2010
While writing an app that uses a couple settings, they occasionally get re-set to empty. I haven't seen any pattern to this, but I do have a vague memory that there are certain circumstances that will reset the settings in a project under development. What are the circumstances that cause the settings to be reset?
View 6 Replies
Jan 21, 2011
Whenever I name a new project, a file download window comes up. I tried to reset visual studio to default setting and even uninstalled firefox. I'm trying to get visual studio to behave like it use to. url....
View 5 Replies
Jan 19, 2010
I recently made an application which have some settings one of them a saving path
I want to make check if the saving path settings is available or not (drive)
If not so it got a default value which is application path
I tried to Change the default settings in the My.Settings by writing "Application.startuppath"But the application accept it as a string is there any way do dodge this problem?
View 6 Replies
May 20, 2009
I want to create a Timer such that I can reset the time to say 00:00:00 (hrs:mins:sec) and be able to stop, reset and start the timer as needed. I have actually created one from the scratch but it seems like it is long on code. Any ideas on how best to do this?Only performance counts!
View 19 Replies
May 25, 2011
I have a repeater which displays products. Users can select a Size - dropdownlist and an Amount - textbox. Then they press Order or Cancel. When they press Cancel I would like the values of Size and Amount to return to their default values.
Protected Sub lbtnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtnCancel.Click
rpt.ProductList is the repeater name
lblFeedback.Text = ("")
lblFeedback.ForeColor = Drawing.Color.Black
End Sub
I am using VB.NET.
View 2 Replies
Jun 12, 2011
I can't seem to get this code to refill the chart with new dat. The first time it executes, all is great, but when I change the year(numericupdown1.value) it adds a new set of data points instead of re-plotting the original set.
Private Sub FillChart()
'
'Fill Chart subroutine
'
Dim SoldMonth As Date
[code]....
View 10 Replies
Oct 17, 2011
It's good to be back in this forum again hoping someone could help me solve my problem again xD My goal is to import .txt to db.
This is my code
[code]...
Some of the records are inserted but when the code read the part where there is an empty/null value in the column where they are assigned as "decimal" the error message "Error converting data type nvarchar to numeric." pops out.
View 4 Replies
Jun 23, 2009
I am trying to reset all integer values to "0" with a reset button.I try not to use hardcoding by simply set them one by one. So my idea was checking all the variable's type and set them all to "0".
I tried to use this methode, from someone in this forum (sorry, I forgot the name but this is very helpful...) For Each ctrl As Control In Me.GroupBox4.Controls 'Check and see if this control is a TextBox
If Object.ReferenceEquals(ctrl.GetType(), GetType(Label)) Then 'Check and make sure this s the "TextBoxToExclude"
'CType(ctrl, CheckBox).Checked = False
CType(ctrl, Label).BackColor = InactiveColor
End If
Next
But when I tried to find the code, I couldn't get it.So, if anyone knows how to do this,
View 19 Replies
Feb 11, 2011
Windows resets the IDLE time every time the user touches the keyboard or the mouse. My application needs to reset the IDLE time at specific moments, but how to do this programmatically.
The following does NOT reset the IDLE time using VB, C# or QT4.
- Programmatic mouse movement / click.
- Programmatic keystroke.
Somehow Windows knows these actions are simulated. How can I reset the IDLE time?
View 3 Replies
Jan 27, 2011
i have a textbox with hexadecimal values and i would like to use the slidebar/scrollbar to change the values (increase/decrease) then save the final values to a text file. To prevent the program from writing to many times to the file, i decided to use a timer. As long as the user still making changes or controlling the slide/scroll bar the timer will re-load (5 seconds). When the user is done modifying (no more dragging or clicking on the arrows) at that time the timer already expired, then the value get recorded to the text file.
[Code]...
View 8 Replies
Aug 7, 2009
how to programically clear the data from a form view using vb.net. I have so far come up with the following:
Dim x
For x = 0 To Me.Controls.Count - 1
'if it is a text box then clear it
[Code].....
View 5 Replies
May 16, 2012
I have a small dataset which has most of its schema defined at design time, but I add a few columns to one of its tables at runtime. My problem is how do I reset those changes? he dataset is not linked to any datasource. It just has its own table which I "manually" populate. The static columns have been added to the datatable at design time. However, I add a few columns as runtime based on a list of categories. Like this:
[Code]....
The dataset is used in a small dialog that pops up within my application. I add the dynamic columns when the dialog is opened by using the Load event. Everything works great the first time. But if you close the dialog and reopen it, there are problems. My startup routine tries adding the dynamic columns again, but an error is thrown saying the column already exists. I have tried a lot of things and did some reading but I can't figure out a way to reset the dataset when the dialog is closed. The only solution is to close the whole application and reopen it. I have tried the following in the Leave event of the dialog form:
[Code]....
View 3 Replies
Feb 1, 2012
I am getting a run-time error within my VB app: Run-time error '429': ActiveX component can't create object. It goes away after IIS reset.
View 5 Replies
Mar 22, 2011
For instance every new project i find my self setting the same font/size, Form1 Name, form settings, form regions, modifiers etc
View 1 Replies
Dec 6, 2011
Here is my case:I have a richtextbox called Rtb1 I have the text property for this control set to "ThreadAmountEdit=[Thread Amount]" This was set through the RichTextBox Tasks function, by clicking the control and selecting the little arrow in the top right corner. In working on my form, I edit the text "[Thread Amount]" of the rich text box to "45". What I need is to be able to reset Rtb1 back to default ("ThreadAmountEdit=[Thread Amount]")on button click.
I've tried: Rtb1.Refresh() which doesn't appear to do anything I've also tried Rtb1.ResetText() which completely clears the textbox.
View 2 Replies
Jan 15, 2012
My Program changes it's My.settings to default , it looses the Location Where it is saved This only happens when i move to a new area But if i take a new builded exe and put it in same Dir of old exe then It Remembers old Settings?
View 7 Replies
Aug 27, 2008
I created a mail sending software. The problem is it cant get the default SMTP settings of a machine. How to do that in visual basic 2005 (VB.Net 2).I tried to parse it from outlook.But failed. Again, some other software can get it without outlook. So, i want to know the way of getting this settings.
View 3 Replies
Mar 30, 2009
I had a quick google nothing come up.For instance every new project i find my self setting the same font/size, Form1 Name, form settings, form regions,modifiers etc
View 2 Replies
Jun 28, 2011
I am practicing on how to print from vb.net (2008) i was able to print my text, however I am having hard time changing default page settings.When the script loads up it thinks my default printer is my 8x11 printer and adjusts the label for that. however I am using a small label printer and labels are very small like 1x2inch. After I hit print button I can get the printer dialog box up change the prinet however because margins are wrong, my print out is unaligned. I like to change my default printer at form load step.
View 1 Replies
Aug 13, 2009
I am am having some problems with using My.Settings. I have saved some strings with My.Settings.Save() and am trying to set the strings back to its default value. I have tried using My.Settings.Reload() but it does not do anything. What is the best way to set the strings back to its default value that I have set it to? I have looked around for this question but could not understand what to do to fix the problem. I have gone to msdn.microsoft.com but could not find any good information, only this[URL]..
View 7 Replies
Oct 21, 2009
Using VB2008 Express and I have a group box and in Propities|application Settings I have the backcolour set so that it is saved when the program closes. I have noticed in the "Settings. settings" file it has the default colours, but how do I get them?
<Setting Name="GroupBox1" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">235, 235, 235</Value>
</Setting>
View 6 Replies