vb.net

LB_SETTABSTOPS does not appear to affect a CheckedListBox

I am trying to set tab stops in a CheckedListBox in my WinForms application, but no matter what I do, it does not seem to have any effect. I have the following in the code for my form: <DllImport("user32.dll")> _ Public Sub SendMessage(ByVal hWnd As IntPtr, ByVal uMsg As Int32, ByVal wParam As Int32, ByRef lParam As Int32) End Sub Publ...

System.OutOfMemoryException was thrown. at Go60505(RegexRunner ) at System.Text.RegularExpressions.CompiledRegexRunner.Go()

Hi All, I am a c# dev working on some code for a website in vb.net. We use a lot of caching on a 32bit iss 6 win 2003 box and in some cases run into OutOfMemoryException exceptions. This is the code I trace it back to and would like to know if anyone else has has this... Public Sub CreateQueryStringNodes() 'Check for nonstandard ch...

How do I embed a Gecko or FireFox browser into a VB.NET application?

I am having some problems trying to embed Gecko or Firefox into my VB.net application - specifically when running on Vista or Windows 7. Is this possible to do? Or should I look for a different alternative? Any links to documentation would be greatly appreciated. ...

Performance problem with System.Net.Mail

I have this unusual problem with mailing from my app. At first it wasn't working (getting unable to relay error crap) anyways I added the proper authentication and it works. My problem now is, if I try to send around 300 emails (each with a 500k attachment) the app starts hanging around 95% thru the process. Here is some of my code whic...

How to access resources from an external assembly.

I want to create a vb.net project that I will use to only hold image and string resources that I will need in multiple projects. What I can't figure out is how do I access these resources using code from other projects. ...

VB Equivalent of C# Event Creation

I'm trying to extend the GridView class to always show the header and footer even when the datasource is empty by using the code I found online (link). However, the code is written in C# but I use VB. What is the VB equivalent of the following? public event MustAddARowHandler MustAddARow; Is there a way around VB.NET not allowing ev...

Am I Leaking ADO.NET Connections?

Here is an example of my code in a DAL. All calls to the database's Stored Procedures are structured this way, and there is no in-line SQL. Friend Shared Function Save(ByVal s As MyClass) As Boolean Dim cn As SqlClient.SqlConnection = Dal.Connections.MyAppConnection Dim cmd As New SqlClient.SqlCommand Try cmd.Conne...

VB Equivalent of C# Type Check

What is the VB Equivalent of the following C# boolean expression? data.GetType() == typeof(System.Data.DataView) Note: The variable data is declared as IEnumerable. ...

Retrieving data from ListView control in VB.NET

I have a ListView setup in details mode that looks like this: When the user presses the delete button, I need to go ahead and delete their record from the database. This I can do fine, but I'm stuck on how I retrieve the data that is highlighted in the ListView control. I've tried using Google but all the examples I found have failed ...

Perform Grouping of Resultsets in Code, not on Database Level

Stackoverflowers, I have a resultset from a SQL query in the form of: Category Column2 Column3 A 2 3.50 A 3 2 B 3 2 B 1 5 ... I need to group the resultset based on the Category column and sum the values for Column2 and Column3. I have to do it in code because I ...

Is the 'Is' VB.NET keyword the same as Object.ReferenceEquals?

Is the Is VB.NET keyword the same as Object.ReferenceEquals? ...

how to access class and its functions from another class

This is my first major application using multiple classes. It is written in vb and I know about creating objects of the class and using that instance to call functions of the class. But how do I create an object with constructors to allow another program written in C# to access my classes and functions and accept things from the program....

Help converting a VB.NET "Handles" statement to C#

I need help converting a VB.NET handles statement to C#. This is the VB Private Sub ReceiveMessage(ByVal rr As RemoteRequest) Handles AppServer.ReceiveRequest 'Some code in here End Sub ...

Why do C# automatic properties not support default values like VB 2010?

Looking at the new VB 2010 features, I stumbled upon support for Auto-Implemented Properties. Since I'm working with C#, this seemed quite familiar, but I noticed that VB did add a feature I would love to have in C#: setting a arbitrary default value for the auto-implemented property: I really like the clean usage of auto-properties...

Adding items to the List at creation time in VB.Net

In c# I can initialize a List at creation time like var list = new List<String>() {"string1", "string2"}; is there a similar thing in VB.Net? Currently I can do it like Dim list As New List(Of String) list.Add("string1") list.Add("string2") list.Add("string3") but I want to avoid boring .Add lines ...

Has Object in VB 2010 received the same optimalization as dynamic in C# 4.0?

Some people have argued that the C# 4.0 feature introduced with the dynamic keyword is the same as the "everything is an Object" feature of VB. However, any call on a dynamic variable will be translated into a delegate once and from then on, the delegate will be called. In VB, when using Object, no caching is applied and each call on a n...

Getting my string value from my form into my class( not another form)

Hello all, I have a question regarding the some data which is being transfered from one form to my class. It's not going quite the way i'd like to , so I figured maybe there is someone who could help me. This is my code in my class Public Class DrawableTextBox Inherits Drawable Dim i_testString As Integer Private s_InsertLabel A...

String.IsNullOrEmpty and Datarow.IsXnull

How can I improve this code? What has made this long winded is the fact that I can't use string.IsNullOrEmpty on a data row and instead I have to use a dr.IsHOUSENUMBERNull method AND the string.IsNullOrEmpty to check if it is empty. Why is this? The column in the database is sometimes empty and sometimes NULL. I'm sure this can be w...

Get label height for fixed width

Is there any way I can get the height of a label, if it hypothetically had a certain width? I've been trying with control.GetPreferredSize(size) like so: Dim wantedWidth as Integer = 100 dim ctrlSize as Size = label.GetPreferredSize(new Size(wantedWidth, 0)) because I thought that setting height = 0, would indicate a free height, but ...

Inline list initialization

How is the following translated in VB.net: var theVar = new List<string>{"one", "two", "three"}; ...