vb.net

label backgrond flicking on a WinForms user control has background image enabled

I am working on a windows form project and having some problem with UserControl Double Buffering. I created a usercontrol and has a background image, then on top of it I have few radio buttons and labels. Radio buttons and labels are all having transparent background as color. However, when I show and hide the User control, I can see the...

Treeview DatafieldParentID Bind to Object whose property is a another object

I am trying to bind Generic collection to a Rad Treeview control. In following case CategoryCollection Returns collection of Category Object, which has bunch of properties and A Parent property which is a object and this parent object Has Id and text properties. What I am trying to do is: I want to Bind DataFieldParentID of the tree view...

what's an option strict and explicit?

I saw this post: "Typos… Just use option strict and explicit please.. during one software development project, which I was on as a consultant, they were getting ridiculous amounts of errors everywhere… turned out the developer couldn’t spell and would declare variables with incorrect spelling.. no big deal, until you use the correct s...

VB Classes Best Practice - give all properties values?

Sorry if this is a bit random, but is it good practice to give all fields of a class a value when the class is instanciated? I'm just wondering if its better practice to have a constuctor that takes no parameters and gives all the fields default values, or whether fields that have values should be assigned and others left alone until req...

create and write to a text file in vb.net

I'm creating a small vb.net application, and I'm trying trying to write a list of results from a listview to a text file. I've looked online and found the code to open the save file dialog and write the text file. When I click save on the save file dialog, I receive an IOException with the message "The process cannot access the file 'C...

Quick question about a reference type key in a generic dictionary in .Net

I have a mutable class that I'm using as a key to a generic dictionary. Two keys should be equal only if their references are equal. From what I've read, in this case, I don't need to override Equals, GetHashCode , or implement IEqualityComparer. Is this correct? ...

redirect an event in VB.NET

I havea a UserControl1 (in witch I have an Label1) in Form1. I want to catch the MouseDown event from Label and send it like it was from UserControl. I do: Public Class UserControl1 Shadows Custom Event MouseDown As MouseEventHandler AddHandler(ByVal value As MouseEventHandler) AddHandler Label1.MouseDown, value End A...

How to draw "on top" of hosted controls in .NET?

Hi all, I am working on a simple form builder which hosts "live" .NET objects as well as performing its own drawing for guidelines (grid), object selection etc. Things are going well but as you see below, the custom painting is not exactly optimal since it always paints behind the hosted controls. How can I modify my painting logic t...

Read sms from Mobile device with .net application?

Hello Friends, Can anyone help me? How can I read SMS from mobile with my .net application? i have a Nokia 5310 mobile phone. Can you tell me from where i can download Nokia SDK or source code or Nokia API etc? I want to make a custom application which reads SMS and at the same time sends a response to the sender's mobile number. ...

DataBinding: ComboBox.Text not updating when SelectedValue changes?

This is the relevant designer code for the ComboBox: Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Enabled", Me.RegistrationBindingSource, "IsRegistered", True)) Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.RegistrationBindingSource, "ProbationID", True)) Me.Probati...

Multi-threading mechanisms to run some lengthy operations from winforms code and communication with GUI

What do I want to achieve: I want to perform some time consuming operations from my MDI winforms application (C# - .NET). An MDI child form may create the thread with the operation, which may take long time (from 0.1 seconds, to even half hour) to complete. In the meantime I want the UI to respond to user actions, including manipulatio...

What's the most efficient way to combine two List(Of String)?

Let's say I've got: Dim los1 as New List(Of String) los1.Add("Some value") Dim los2 as New List(Of String) los2.Add("More values") What would be the most efficient way to combine the two into a single List(Of String)? Edit: While I love the solutions everyone has provided, I probably should have also mentioned I'm stuck using the .N...

www.asp.net/learn Is gone, or it's archived somewhere?

I had a bunch of bookmark to "www.asp.net/learn/", specially the one about data-access and security. I was keeping them to send them to newbies. The site seem to be wiped. Someone found an archive??? ...

radiobutton not working in allkeys

i have a radiobutton built throught my code. this is the code for that. dim 1 as intereger = 0 Dim rd As New RadioButton rd.ID = "rd_" & i rd.GroupName = "rd_g" TD.Controls.Add(rd) i = i+1 the reason i gave groupname is so that when i select the radiobutton only one is select...

Visual Basic (VB) Forms: wait for a user click?

Making a simple form that is to step through a program iteratively. How can I get it to run a method each time a user clicks a button and wait once it is finished for the next click? Thank you. ...

Me.Invoke in VB.NET doesn't actually "Invoke" - threads stall on Invoke statement

I've got the following code: Public Delegate Sub SetStatusBarTextDelegate(ByVal StatusText As String) Private Sub SetStatusBarText(ByVal StatusText As String) If Me.InvokeRequired Then Me.Invoke(New SetStatusBarTextDelegate(AddressOf SetStatusBarText), StatusText) Else Me.labelScanningProgress.Text = StatusText ...

vb.Net: How can I read a large XML file quickly?

I am trying to read this XML document. An excerpt: <datafile xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wiitdb.xsd"> <WiiTDB version="20100217113738" games="2368"/> <game name="Help Wanted: 50 Wacky Jobs (DEMO) (USA) (EN)"> ...

how to combine combo box contents in vb.net

I have this, birthday selection which is in 3 combobox, 1 for month, 1 for day and 1 for year. But my database table has only this birthday attribute(no year, month or day). How can I combine the items that are selected in those 3 combo boxes so that they would be fitting in the birthday column? ...

VB.Net Custom Controls

This might be basic question, however I am confused on some .Net Concpets. I am trying to create a "Data Browser" in VB.net. Similar to a Web Browser however each Tab in the Data Browser is a view of some Data (from a database or flat files) not a webpage. The UI on each Tab is mostly the same. A list Box (showing datatypes, etc), a ...

How to clear combo box contents in vb.net

If for textbox it is textbox1.clear, etc. What is the equivalent for combobox to clear the value. ...