vb.net

How can I assign an event to a timer at runtime in vb.net?

Given this: Public Sub timReminder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) If DateTime.Now() > g_RemindTime Then Reminders.ShowDialog() timReminder.Enabled = False End If End Sub I want to be able to say this (as I would in Delphi): timReminder.Tick = timReminder_Tick But I get error...

Passing Objects via QueryString

I have object A which in turn has a property of type Object B Class A property x as Object B End Class On my ASP.NET page when I select a gridview item which maps to an object of type A I serialize the object onto the QueryString and pass it to the next page. However I run into problems if property x actually has some value as it ...

C# functions with static data

In VB.Net, I can declare a variable in a function as Static, like this: Function EncodeForXml(ByVal data As String) As String Static badAmpersand As Regex = new Regex("&(?![a-zA-Z]{2,6};|#[0-9]{2,4};)") data = badAmpersand.Replace(data, "&") ''// more processing return data End Function Note that I need to use t...

What are the pros of VB.NET?

Can anyone help me understand some of the pros (and some of the cons if they are constructive) of using VB.NET over say, C#? ...

Visual Studio 2008: is there any way to turn on the Class Name/Method Name drop downs in C#? (like VB.Net has)

I'm working in .Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the few things from VB that I actually miss. Edit: Also, is there any way to get the drop downs to be populated with the possible ev...

VB.Net Automating MS Word for Spell Check Capabilities

An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the Office 12 objects what will happen on boxes which have Office 2003? This is in regards to ...

Compile error in VS.NET 2008 (VB.NET) that I can't get rid of!!

I can't shake this error when compiling my Visual Studio.NET 2008 solution. The project that's generating the error is a VB.NET Web Application in a 12 project solution (mixed types and languages). I've tried all the tricks I can find on google, and the obvious of removing the directoy and folder manually. I'm running Vista Business 3...

String problem with SQL Reader?

Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = "connect timeout=9999999;" & _ "data source=" & DefaultIserver & ";" & _ "initial catalog=" & DefaultIdBase & "; " & _ ...

What would be the best way to parse this file?

Hi all, I was just wondering if anyone knew of a good way that I could parse the file at the bottom of the post. I have a database setup with the correct tables for each section eg Refferal Table,Caller Table,Location Table. Each table has the same columns that are show in the file below I would really like something that is fairly ge...

Refactoring Code: When to do what?

Ever since I started using .NET, I've just been creating Helper classes or Partial classes to keep code located and contained in their own little containers, etc. What I'm looking to know is the best practices for making ones code as clean and polished as it possibly could be. Obviously clean code is subjective, but I'm talking about ...

Prevent Legacy Function Calls In VB.NET

Within Visual Studio 2008, what would be the easiest way to prevent usage of certain functions from being allowed? Specifically, I'm trying to prevent other developers from using "old school" VB6-style commands such as: Len LCase UCase Instr InstrRev Trim Right Left Mid etc., etc., etc.... The list goes on and on. I can usually ca...

.NET DBNull vs Nothing across all variable types?

I am a little confused about null values and variables in .NET. (VB preferred) Is there any way to check the "nullness" of ANY given variable regardless of whether it was an object or a value type? Or does my null check have to always anticipate whether it's checking a value type (e.g. System.Integer) or an object? I guess what I'm lo...

Flowlayout panel not display the scroll bar after some resizes.

I have a flowlayout panel and on a resize event, I resize all the controls inside the flowlayout panel so they the width of the (flowlayoutpanel - padding - scroll bar width). On some resizes, the scroll bar is not shown, hiding most of the controls outside the area of the flowlayoutpanel while on other resizes the scroll bar is shown.I...

Assembly dependencies with .Net projects

If I have an assembly (A) which references another assembly (B). I want to reference A in a project, I add the reference and it copies A into my BIN directory. It does not copy B as well, even though A depends on it, so the code doesn't compile. How can I set things up so that whenever I reference A, both A and B get copied to my bin d...

Unable to serialize a property on a control

Background I am trying to create a copy of a business object I have created in VB.NET. I have implemented the ICloneable interface and in the Clone function, I create a copy of the object by serializing it with a BinaryFormatter and then de-serializing straight back out into another object which I return from the function. The class I...

Beginner: Fastest way to cast/copy byte() into single()

I've got a byte() array returned as result of directx sound capture, but for other parts of my program I want to treat the results as single(). Is trundling down the array item by item the fastest way of doing it or is there a clever way to do it ? The code that gets it is CType(Me._applicationBuffer.Read(Me._nextCaptureOffset, GetTyp...

Architecture for easy update of application

I have a system in place which applies calculations to a set of numbers (the specifics aren't really relevant). There are a number of sets of calculations which can be applied by the system users and new sets are added frequently. Currently when a new set of calculations need to be added to the system they are added in to the code base a...

Detecting Graphic Options in .NET

What is the the best of detecting and later altering the screen resolution and multiple desktop within .net I have a small app that while runs at work on my multiple monitor/high(ish) resolution however what I want to be able to detect is the users primary monitor and set the application to that (main objective) and adjust the resolutio...

Most Wanted Features for Visual Basic 10.0

In the vein of Most Wanted Feature for C# 4.0, what would you like to see in the next version of VB.NET? ...

vb.net - sending UDP data including hex

As a hobby i'm interesting programming a Ethernet connected LED sign to scroll messages across a screen. But I'm having trouble making a UDP sender in VB .net (using 2008 currently) Now the sign is nice enough to have a specs sheet on programming for it: http://support.favotech.com/protocol.specs.2.4.jetfile.pdf But an example of a lin...