What is the easiest way to save settings in VB.net - windows

I am creating a program which launches a game server. I have combobox in which the user can enter the ip, map, etc, of the game. How can I save what they have entered so that the next time they are already there so they don't have to re-enter them.

Use Visual Studio's Settings Designer, Right click on your project then properties, navigate to the settings section, from there, you can add anything you want.
then you can access your settings from code like so
My.Settings.nameOfSettingsEntry = value
My.Settings.Save()
you'll find more details and screenshots here,

You can also bind the settings to the control using the Properties Window.
Right click your project in the Solution Explorer and choose Properties. Go to Settings and create a new String setting. Then click on your ComboBox and open up the Application Settings > PropertyBinding section from the Properties Window. From there you can bind the control's text property to the String setting you just created.

Related

Data Driven Coded UI Testing in Visual Studio

I am curious about an issue in Coded UI Testing. For example I created a button named Button1. I did assertions and everything is fine. Then I changed this button's name to Button2. Now, do I have to write my assertions again or is Coded UI Test can suit in every different name change. Notice that I am not doing any input or parameter changes, I am just changing user interface. Thanks for your replies.
You should be able to change the test code easily to cope with a name change like that. Open the UI Map file in the UI Map editor; ie double-click on the uimap.uitest file in solution explorer. In the left hand pane expand the method and select the action that clicks the button. That should open the relevant control in the right hand pane. Alternatively just find the control for the button in the right pane. View the properties of the button and click on the ellipsis of the "(collection)" value of SearchProperties or the FilterProperties. One of the items shown should be the old name of the button, just rename it there.

Visual Studio 2008: How to view “Advanced” properties in the Properties window?

Whenever I click on an object in the Solution Explorer, in the Properties Dialog, all I can see are the "Misc" properties, usually File Name and File Path, but I need to see the "Advanced" section. Under Tools -> Options -> Text Editor -> C#, there is a checkbox labeled "Hide advanced members". This was unchecked by default, and I've tried checking + restarting visual studio, unchecking again. Regardless, it's still hidden. I'm not even sure that this relates to Properties, but this was suggested as a solution before. How might I go about fixing this?
EDIT: I'm referring to the properties of files within the project, not the project or solution properties.
This is normally the case for projects and solutions - the properties window only has the file name and path.
Right click on the solution or project node and select Properties. This will bring up the properties pages for them, instead of the properties window (F4).
If you click on the object in the solution explorer it just shows you the Advanced and Misc properties. If you want to see all the specific properties of the object click on the object itself in the [Design] window.
check the location of folder the items are stored in if they are in folders, they have to be under the project name and not the solutionenter image description here

Windows Explorer: How to create additional button?

Explorer of Windows 7 uses a new light-blue bar with buttons like "Organize", "Share", "New Folder" etc.
How can I create a new button ? Do I need to create a plugin for explorer.exe, and if, how do I do it (using Visual Studio .NET) ?
Or is it a simple registry key I have to set which points to an exe or bat?
Thanks in advance and best regards
It's a registry key, but not quite so simple. You have to do several steps to add one button.
You may have noticed that the Win7 Explorer adjusts its toolbar to match the content that is being displayed. For example the buttons shown for the control panel folders are different than the ones for documents or the music library folder. You can find a large list of different folder types under the registry key
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes
Click on each UID shown there to find out what folder type it is for. For example here you see the entry for folders in the generic library type:
So the first thing you have to do is to find the folder type for which you want to add your own button.
Once you found the right UID, you might have to take ownership of those keys. Otherwise you won't be able to modify them:
Right-click on that key and choose Permisssions...
Click the Advanced button.
Click the Owner tab.
Under Change Owner to: select Administrators.
Click Apply and verify that "Current Owner" is set to Administrators.
Click OK to save the change.
Back in the Permissions dialog, click Administrators and then click (to check it) Full Control
Click OK to save the settings and close the dialog box.
The next step is to create the keys and values necessary for your own button:
Add a new key, TasksItemsSelected
Add a new key, TasksItemsSelected\0
Create a new GUID (use guidgen.exe) for your command.
add the key TasksItemsSelected\0\<yourguid>, then add the strings Title and InfoTip and give them the appropriate values. You can also set an icon here, using the string Icon with the value pointing to an icon file.
Add the keys TasksItemsSelected\0\<yourguid>\shell\InvokeTask\command
as default value of the command key, enter the command you want to execute.
Now your registry entry should look something like this:
When the command runs, it will receive at least two parameter values.
%1 -- The path of the folder that was being displayed
%2 -- The pathname of the file that was selected.
If you select more than one file before clicking the mycommand button, then the subsequent filenames will be in subsequent parameters.
And last but not least: if you want to add your own button for situations where nothing is selected, do everything as mentioned above, but use the registry key TasksNoItemsSelected instead of TasksItemsSelected

How to enable the dropdown above the text editor in visual studio

For some reason I've lost the dropdownbox above the text editor. The one that lists all methods, variables and properties in a class. And it makes me go crazy when I browse larger classes.
Maybe it is easier to enable "Navigation bar" option under "Tools->Options->Text Editor->[The language that you using]->General]
Have you tried resetting the interface?
from the command line run devenv.exe /resetsettings
2.. From Visual Studio
On the Tools menu, click Import and Export Settings.
On the Welcome to the Import and Export Settings Wizard page, click Reset all settings and then click Next.
If you want to save your current settings combination, click Yes, save my current settings, specify a file name, and then click Next.
—or—
If you want to delete your current settings combination, choose No, just reset settings, overwriting my current settings, and then click Next. This option does not delete default settings, which will still be available the next time you use the wizard.
In Which collection of settings do you want to reset to, select a settings collection from the list.
Click Finish.
The Reset Complete page alerts you to any problems encountered during the reset.

Open Dialog preserving settings

How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified.
Microsoft didn't see fit to give us any documented way of doing this, but some people have figured out bits of the puzzle. This link shows how to set the view, but not how to get the current setting:
http://msdn.microsoft.com/en-us/magazine/cc164009.aspx
I'm not quite sure about this about isn't it an OS setting. If the user choose their Folder Preferences such as then Windows will remember or not. In this case from accessibility and usability point of view this is User's preferences.
You could inherit from the dialog's class and then see what can be overriden to do the persistence of its state.
Simple non-technical solution.
This worked for me (WinXP SP3) in some cases but not all. Since you don't have the option of changing things in a common Open dialog, you can try to do it in Windows Explorer.
Open Windows Eplorer. If you want to change the sort order, go to the details view and click on the column to sort, normally Name, but you may want to sort by Date. Now change
the view back to whatever you want. Now select "Tools" then "Folder Options". On the General tab, for "Tasks" select "Use Windows classic folders," for "Browse folders" select "Open each folder in same window." Now click the "View" tab. Scroll down and check the box for "Remember each folders view settings." If it's already checked, uncheck it then check it again. Click the "Apply" Button at the botton of the window. Click the "Apply to All Folders" button near the top. These settings may show up in your Open dialog. Having done this you can now change the settings in Windows Explorer or any other Folder window that allows you to change them and that Folder window should remember them. This fixed the Open dialog in my qraphics editor but not in my video editor.

Resources