473,616 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Default Settings in My.Settings

AGP
VB.NET 2005
I've been working extensively with saving and loading my settings via the
My.Settings class. its worked out great except that i cant figure out how to
set a default setting that is dynamic. That is to say, the default property
changes per user or per machine. As an example, and this is only an example,
the default setting for the center of the screen. In the IDE I can set the
parameter as

ScreenCenter | System.Drawing. Point | User | "0,0"

the default here being 0,0 as i cant make that value dyanmic in the IDE.
Once the user has used the program and then closed then the actual value
gets updated and the default is no longer used. Is there a way to override
the deafult value with a dynamic value that is determined on startup. I have
more settings like this that need a default value to be determined
dynamically. In VB6 I could call the INI API and give it a default value
that could be dynamically determined. i was hoping there was also a
mechanism like this in VB.NET.

tia

AGP
Sep 3 '08 #1
6 4482
On Sep 3, 7:26*am, "AGP" <sindizzy....@s ofthome.netwrot e:
VB.NET 2005
I've been working extensively with saving and loading my settings via the
My.Settings class. its worked out great except that i cant figure out howto
set a default setting that is dynamic. That is to say, the default property
changes per user or per machine. As an example, and this is only an example,
the default setting for the center of the screen. In the IDE I can set the
parameter as

ScreenCenter *| * System.Drawing. Point * | * User * * | * "0,0"

the default here being 0,0 as i cant make that value dyanmic in the IDE.
Once the user has used the program and then closed then the actual value
gets updated and the default is no longer used. Is there a way to override
the deafult value with a dynamic value that is determined on startup. I have
more settings like this that need a default value to be determined
dynamically. In VB6 I could call the INI API and give it a default value
that could be dynamically determined. i was hoping there was also a
mechanism like this in VB.NET.

tia

AGP
Are you meaning resetting settings to initial version or reloading
settings to most recently saved version?

Here is a good insight from page 4 from article:
http://www.devcity.net/Articles/281/4/article.aspx

And My.Settings has "Reset" and "Reload" methods:
http://msdn.microsoft.com/en-us/libr...13(VS.80).aspx

Hope this helps,

Onur Guzel
Sep 3 '08 #2
AGP

"kimiraikko nen" <ki************ *@gmail.comwrot e in message
news:0b******** *************** ***********@l42 g2000hsc.google groups.com...
On Sep 3, 7:26 am, "AGP" <sindizzy....@s ofthome.netwrot e:
VB.NET 2005
I've been working extensively with saving and loading my settings via the
My.Settings class. its worked out great except that i cant figure out how
to
set a default setting that is dynamic. That is to say, the default
property
changes per user or per machine. As an example, and this is only an
example,
the default setting for the center of the screen. In the IDE I can set the
parameter as

ScreenCenter | System.Drawing. Point | User | "0,0"

the default here being 0,0 as i cant make that value dyanmic in the IDE.
Once the user has used the program and then closed then the actual value
gets updated and the default is no longer used. Is there a way to override
the deafult value with a dynamic value that is determined on startup. I
have
more settings like this that need a default value to be determined
dynamically. In VB6 I could call the INI API and give it a default value
that could be dynamically determined. i was hoping there was also a
mechanism like this in VB.NET.

tia

AGP
Are you meaning resetting settings to initial version or reloading
settings to most recently saved version?

Here is a good insight from page 4 from article:
http://www.devcity.net/Articles/281/4/article.aspx

And My.Settings has "Reset" and "Reload" methods:
http://msdn.microsoft.com/en-us/libr...13(VS.80).aspx

Hope this helps,

Onur Guzel
>>
no i dont mean that. I mean what i stated...the default value for a setting
could be dynamic depending on the user. i know how to setup the settings but
the first time the user uses the program the default setting is based on
their computer, their screen, their user name, their OS, etc. The default is
dynamic depending on the user.

AGP
Sep 4 '08 #3
AGP wrote:
>
no i dont mean that. I mean what i stated...the default value for a
setting could be dynamic depending on the user. i know how to setup
the settings but the first time the user uses the program the default
setting is based on their computer, their screen, their user name,
their OS, etc. The default is dynamic depending on the user.
I would claim that is not really a default anymore. But that's just semantics.

Make a setting called "Initialize d" which has a default (a real default) of
False. Check for that first. If it is false, then calculate and set all the
other settings, effectively ignoring their dummy default values. Then set
Initialized to True, and carry on.
Sep 4 '08 #4
AGP

"Steve Gerrard" <my********@com cast.netwrote in message
news:9p******** *************** *******@comcast .com...
AGP wrote:
>>
no i dont mean that. I mean what i stated...the default value for a
setting could be dynamic depending on the user. i know how to setup
the settings but the first time the user uses the program the default
setting is based on their computer, their screen, their user name,
their OS, etc. The default is dynamic depending on the user.

I would claim that is not really a default anymore. But that's just
semantics.

Make a setting called "Initialize d" which has a default (a real default)
of False. Check for that first. If it is false, then calculate and set all
the other settings, effectively ignoring their dummy default values. Then
set Initialized to True, and carry on.

ok but how does one go about using the same My.Settings class to do that. My
whole idea is to present the user with default properties by using the
My.Settings class. The screen was one example but lets say i would like him
to enter his user name and the default is his logon name and he could change
that at app startup. This is only an example but if i want to continue using
the My.Settings class then how would i dynamically change the default. Again
the INI API has a default that you can dynamically change and all im looking
for is a similar mechanism.

AGP
Sep 4 '08 #5
AGP wrote:
>
ok but how does one go about using the same My.Settings class to do
that. My whole idea is to present the user with default properties by
using the My.Settings class. The screen was one example but lets say
i would like him to enter his user name and the default is his logon
name and he could change that at app startup. This is only an example
but if i want to continue using the My.Settings class then how would
i dynamically change the default. Again the INI API has a default
that you can dynamically change and all im looking for is a similar
mechanism.
First code that runs goes

If Not My.Settings.Ini tialized Then
My.Settings.Use rName = My.User.Name
' set any other "dynamic defaults" here...
My.Settings.Ini tialized = True
My.Settings.Sav e()
End If

After that one time, the settings will behave as usual.
Sep 4 '08 #6
AGP

"Steve Gerrard" <my********@com cast.netwrote in message
news:nf******** *************** *******@comcast .com...
AGP wrote:
>>
ok but how does one go about using the same My.Settings class to do
that. My whole idea is to present the user with default properties by
using the My.Settings class. The screen was one example but lets say
i would like him to enter his user name and the default is his logon
name and he could change that at app startup. This is only an example
but if i want to continue using the My.Settings class then how would
i dynamically change the default. Again the INI API has a default
that you can dynamically change and all im looking for is a similar
mechanism.

First code that runs goes

If Not My.Settings.Ini tialized Then
My.Settings.Use rName = My.User.Name
' set any other "dynamic defaults" here...
My.Settings.Ini tialized = True
My.Settings.Sav e()
End If

After that one time, the settings will behave as usual.

ok i see what you are saying. ill give that a shot. im surprised that MS
didnt add that as a feature. the My.Settings class is very useful on its own
but it still needs some work IMO. Does VS2008 support dynamic defaults?

AGP
Sep 5 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3960
by: Jennie | last post by:
I need to collect dynamic SQL execution times for a production database. However, the totals are not being updated, despite setting the DFT_MON_TIMESTAMP on. The DFT_MON_TIMESTAMP is listed in the V8 documentation as configurable online. However, after setting the value on, the 'Total execution time' for dynamic SQL is still not collected. I tried resetting the monitors, etc., but the only thing that seemed to work is recycling DB2...
0
3216
by: Kenneth Jonsson | last post by:
I have posted this in microsoft.public.dotnet.framework.aspnet.webservices without any response. My problem is with connections from client computers with a dynamic proxy settings in IE to my WebServices. Any hint would be appreciated . My customer uses automatic proxy settings, from a configuration script, as defined in Internet Explorer / Internet options / LAN settings. My program, in C++, can not connect to the web services server...
7
22481
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
1
4811
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is that i am not able to arrange three things simultaneously,group,users & there functionality simultaneously.dynamic means group & users come from database and groups & users can be increased in number at any time. i am sending code for that tree...
5
12251
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected to the database. SQLSTATE=57030. Background: I created a linked server to DB2 8.1 database which called GRR_DB2Server. In my stored procedure p_FetchRawData, I need to read some data from this linked server GRR_DB2Server and insert them into
2
4145
by: Sin Jeong-hun | last post by:
I've read the "How to: Create Application Settings" article (http:// msdn2.microsoft.com/en-us/library/ms171565.aspx) on the MSDN. It looked fine. But this code is only good when all the settings entries are defined at the compile time. And I have to modify the class itself each and everytime I need more entries. So, is it impossible to get/ save dynamic entries? I mean, instead of, MyUserSettings.Background=color;...
1
1585
by: unsichtbar | last post by:
Sorry, but I'm pretty new to .NET/XML etc... I have the current code which I'm trying to output dynamically so it can be read into a flash file. The only issue is, it doesn't seem to actually do anything. What am I missing? I have been able to output to an xml file, but not dynamically. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Import Namespace="System.Data" %> <%@ Import...
2
10053
by: =?Utf-8?B?QWFyb24=?= | last post by:
I am trying to create dynamic settings in a .NET 2.0 C# application. I need to be able to store settings on the user, but I do not know how many settings are necessary at design time because the settings are determined by a business object that is loaded into the app of which there could be one or many. I would prefer to use the same LocalFileSettingsProvider that the settings default to so that I do not have to manage it myself. Here...
3
2932
by: =?Utf-8?B?U3ViYQ==?= | last post by:
I am using a asp page to dynamically create a stylesheet my asp page creates the following css element when i call the asp page my typing the url in the browser. My asp page works fine............ body { font-family : Arial, Helvetica, Sans-Serif, Verdana ; margin : 0 ; padding : 0 ; }
0
8199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8145
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8592
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8294
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7118
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4060
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1439
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.