Category Archives: vb.net

Store and Retrieve last selected path of FolderBrowserDialog in app.config file

Add the following key value setting under appSettings Section in app.config file. <appSettings>        <add key=”LastOpenedfolderPath” value=”D:\MyXyzFolder” /> </appSettings> VB.Net Code to Retrieve and Store the latest one: Dim folderDlg As New FolderBrowserDialog ‘Retrieving From config file. If there is wrong path was stored in config file, it will open the default Root [...]

VB.NET 9.0: Object and Array Initializers

check out : http://blogs.msdn.com/wriju/archive/2008/02/05/vb-net-9-0-object-and-array-initializers.aspx

FolderBrowserDialog

FolderBrowserDialog allows to create, browse and select the folder from the file system. the SelectedPath will be a string containing the path to the selected folder. ShowNewFolderButton property to control if the user is able to create new folders with the New Folder button. FolderBrowserDialog is a modal dialog box; therefore, when shown, it blocks [...]

Retrieving ip address from connectionstring of app.config file

Here is an example of  retrieving ip address from connectionstring of app.config file. ==> you must referece system.Configuration dll to your project. =========================== imporst system.configuration Dim connStr, serverIP As String Dim startIndex, endIndex As Integer serverIP = “” Try connStr = ConfigurationManager.ConnectionStrings(“MyConnectionString”).ConnectionString startIndex = connStr.IndexOf(“server=”) + 7     ‘ (server=) has 7 characters in it endIndex [...]

datetimepicker: displaying date in custom format

In datetimepicker, if  we want to display date somewhat like below 31 March 2009 then we can do this by setting following properties customFormat :  dd MMMM yyyy format                  : Custom

Follow

Get every new post delivered to your Inbox.