vb.net

Examples of Optimization in VB/VBA/VB.net?

Please post examples of optimization done in VB/VBA/VB.net? Optimization can be in the context of performance or space/maintainability. Edit: Please specify somewhere in your post which environment you know your technique works in. Thanks. ...

Using ExtJS in ASP.NET

I don’t have advanced knowledge in JavaScript, and I am trying to learn how to use ExtJS framework in ASP.NET (C# or VB.NET) environment. I’ve got couple of samples, but was unable get the project working. Can anyone point in the right direction such as website or book so I can go a read up about the ExtJS in more details and how I can i...

How do I get the index of an object in a For Each...Next loop?

I'm using the following syntax to loop through a list collection: For Each PropertyActor As JCPropertyActor In MyProperty.PropertyActors i = IndexOf(PropertyActor) Next How do I get the index of the current object within the loop? I'm using IndexOf(PropertyActor) but this seems inefficient as it searches the collection when I alr...

Converting double array to IComparable array.

I'm trying to create a Quicksort base class using VB.NET, taking it an array of IComparable elements. The signature looks like this: public shared sub Sort(ByVal values() as IComparable) However, when I pass in an array of doubles, the compiler is giving me errors. Dim numbers(100) as double Dim random as new Random(0) for i as in...

Best way to check when a specified date occurs

Are there any classes in the .NET framework I can use to throw an event if time has caught up with a specified DateTime object? If there isn't, what are the best practices when checking this? Create a new thread constantly checking? A timer (heaven forbid ;) )? ...

Ambiguous class members in vb.net

I am trying to use a class from a C# assembly in vb.net. The class has ambiguous members because vb.net is case insensitive. The class is something like this: public class Foo { public enum FORMAT {ONE, TWO, THREE}; public FORMAT Format { get {...} set {...} } } I try to access the enum: Foo.FORMAT.ONE This is not p...

Generic Functions in VB.NET

I'm not too familiar with generics (concept or the syntax) in general (short of using them in collections and what not), but I was wondering if the following is the best way of accomplishing what I want. Actually, I'm not entirely positive generics will solve my problem in this case. I've modelled and mapped a few dozen objects in NHibe...

Is there any good documentation on the VB.Net Project file structure?

I need to start messing with a vb.net(vs2008) project file and I'd like a reference to, ideally, it's specification. Any links would be very helpful ...

GUI For Service Methods

We have a service that runs methods used for data import/export at specified intervals. To test these methods we have a little application with a single button that, when clicked, instantiates the import/export class and invokes the desired method. Nothing fancy. I would like create a more robust test application that can receive debu...

Excel VBA to VB.Net

Can anyone please convert this Excel generated VBA code to vb.net? I need to access the Selection.ListObject.QueryTable object in order to preserve the column width. Thanks!! Range("B9").Select() With Selection.ListObject.QueryTable .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = ...

Usage Statistics: C# versus VB.NET

When .NET was first introduced, it was common (and an obvious choice) for people coming from a VB6 background to jump into the .NET world with VB.NET rather than C#. Today, we use C# for over 90% of our projects, but occasionally we will provide support or services to organizations that have standardized on VB.NET. Today, there several ...

VB.NET - Click Submit Button on Webbrowser page.

I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit: <div id="signin"> <h2 class="ir"> <em></em>Sign in</h2> <form action="/login/" method="post"> <input id="login-url" nam...

UInt32 to Int32

If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net? In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error. I've tried several different method...

ASP.NET User Controls Cross-Communication

The scenario: 2 user controls (foo.ascx and fum.ascx) foo has a method that would really like to access a property from fum. They live on the same page, but I can't find a very simple way to accomplish this sort of communication. Any ideas? ...

Using svn and .NET Winforms - Building Install Files Deletes _svn Folders

Does anyone know how to build an install project without it deleting/overwriting the _svn folders? I have a VB .NET 2005 Winform Application and each time I do an Installer Build, it deletes/overwrites the _svn folder in the directories. How can I stop this from happening? Any and all help is appreciated! Thanks! JFV ...

Moving from vb.NET (2003) to vb2005 What are some of the benefits?

We are changing from vs2003 to vs2005 and use vb as our primary language, I am looking for some of the changes to VB that will be helpful in our ASP.NET development. Can someone point me to a list (maybe from microsoft?) or provide some of their favaorite differences between the two versions? ...

What's the best way to "square" an image in .NET?

I need generate thumbnails for a bunch of jpegs (200,000+) but I want to make sure all of my thumbs have a equal height and width. However, I don't want to change the proportions of the image so I need to add empty space to the shorter dimension to "square it up". The empty space's background color is variable. Here's the code snippe...

How can I call C# extension methods in VB code

I have a class library with some extension methods written in C# and an old website written in VB. I want to call my extension methods from the VB code but they don't appear in intelisense and I get compile errors when I visit the site. I have got all the required Imports because other classes contained in the same namespaces are appea...

How do I turn on Option Strict / Infer in a VB.NET aspx page without a code behind file?

Umm, I guess my questions in the title: How do I turn on Option Strict / Infer in a VB.NET aspx page without a code behind file? <%@ Page Language="VB" %> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) End Sub </script> ...

How do I create a comma delimited string from an ArrayList?

I'm storing an ArrayList of Ids in a processing script that I want to spit out as a comma delimited list for output to the debug log. Is there a way I can get this easily without looping through things? EDIT: Thanks to Joel for pointing out the List(Of T) that is available in .net 2.0 and above. That makes things TONS easier if you have...