Why is it not necessary to indicate ByVal/ByRef anymore?

It seems that this post covers your question: http://msmvps.com/blogs/carlosq/archive/2011/03/15/vs-2010-sp1-changing-quot-byval-quot-vb-net-code-editor-experience.aspx So no, there is no way to get the old behaviour. From now on ByVal is the default (what it was before) and it won’t get added automatically to the method parameters. In my opinion this is a good decision since it’s making VB.NET a bit … Read more

loop over all textboxes in a form, including those inside a groupbox

You can use this function, linq might be a more elegant way. Dim allTxt As New List(Of Control) For Each txt As TextBox In FindControlRecursive(allTxt, Me, GetType(TextBox)) ‘….’ Next Public Shared Function FindControlRecursive(ByVal list As List(Of Control), ByVal parent As Control, ByVal ctrlType As System.Type) As List(Of Control) If parent Is Nothing Then Return list … Read more

Run batch file in vb.net?

You can use the Process class to run a batch file Dim psi As New ProcessStartInfo(“Path TO Batch File”) psi.RedirectStandardError = True psi.RedirectStandardOutput = True psi.CreateNoWindow = False psi.WindowStyle = ProcessWindowStyle.Hidden psi.UseShellExecute = False Dim process As Process = Process.Start(psi)

Crossthread operation not valid… – VB.NET

The purpose of the BackgroundWorker class is to perform work on a non-GUI thread while the GUI remains responsive. Unless you set Control.CheckForIllegalCrossThreadCalls to false (which you shouldn’t do), or use Invoke as suggested in the other answers (which I also wouldn’t recommend), you’re going to get an illegal cross-thread operation exception. If you want … Read more