vb.net

vb.net dynamicly create checkboxes

Hey all, i am trying to figure out how to go about creating dynamic checkboxes on my form when i do not know axacctly how many boxes i will need. The problem is that i do not know how to DIM more than one object. This is my code for creating one checkbox Dim checkBox As New CheckBox() Form1.Controls.Add(checkBox) checkBox.Location = N...

Why assigning 0xFFFFFFFF to a UInteger generates an error in VB.NET?

Pretty simple. UInteger data type hold any value between 0 and 4,294,967,295. MSDN. If I try this code in VB.NET I get a compiler error: Dim Test As UInteger = &HFFFFFFFF Error: "Constant expression not representable in type 'UInteger'. Why I can't set 0xFFFFFFFF (4,294,967,295) to a UInteger if this type can hold this value? ...

Casting a boolean to an integer returns -1 for true?

I am working with some VB.Net code that seems to be casting a boolean value to an integer using CInt(myBoolean). The odd thing that is happening is that it returns -1 if the value is true. For example: CInt(True) // returns -1 CInt(False) // returns 0 Is this common in other languages? I thought that a boolean would be 1 if true an...

VB #If KeyWord - Effect Of #

Google is not good for searching for the # symbol What effect does the # in front of the if make? I am cleaning up someones mess and have never seen this before ...

Shockwave Flash Object in Windows Form VB Help

I can re-size the flash object, but the video area itself stays the same. Even when using scale mode, it will increase the size of the video, but won't surpass the original video area. (Thus cutting off the video.) How do I increase the video's area? Anyone? Please, I've been stuck for a while now... :-( ...

How to get Intellisense to display the meaning of an enum value

I'm wanting to know to get Intellisense in Visual Studio 2005 to display the meaning of individual enum values for a VB.NET project. This already happens for enums that are a part of the .NET library: Is this possible? If so, how would I need to comment my enums to get this to happen? ...

VB.NET: XPath problem

Hi, I have the follwing XML: <?xml version="1.0" encoding="utf-8" ?> <configuracoes> <gerais> <atualizacoes> <tipo>automática</tipo> <frequencia>diária</frequencia> </atualizacoes> </gerais> </configuracoes> And the code: Dim xPathNavigator As XPathNavigator Dim xPathNodeIterator As XPathNodeIterator xPathNav...

ASP checkbox value incorrect when AutoPostBack is set to false

I am still relatively new at VB.Net and Visual Studio and I'm assuming that this is a simple fix, but I'm not sure. I have an asp:checkbox control on an aspx page I am working on. This checkbox is within a custom control and previously was posting back every time it was clicked. I am in the process of ajaxifying the page and have come...

Passing connection strings between assemblies

I have two executables that access a DLL containing Data Access Layer objects Each exe can have a different config containing info on server and database name, connection string etc. How do I pass the config info to the DAL objects? Obviously I can pass the config strings to the DAL objects every time I instanciate one, but that seem...

Induce system lag in vb.net

I need to induce a variable amount of lag in vb.net. System should be noticeably slower. I can raise the CPU usage of the program with infinite loops and some variable creation/assignments, but how can I actually cause lag? I understand this is an odd request, but I appreciate any help and would appreciate it being taken seriously. Th...

How can I find the first value of a variable changed in a vb.net timer?

I have this problem: I have a vb.net class (visual studio 2010) : .... Private nowTime As String .... Protected Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick nowTime = My.Computer.Clock.LocalTime.ToLongTimeString .... End Sub How can I get the first value of "nowTime" String vari...

how to give page-auto-cutter for Dotmatrix(EPSON-LX300) printer..?

hi, am designing invoice for a sale Shop. so am using 'printLine' function to design my Invoice and printing it by BATCH execution. Now my Invoice works(Prints) fine but, IN my EPSON LX300 printer after printing the INVOICE it is going to the next sheet (B4 type sheet).(STOP THE PAPER AFTER THE Last-Line of MY INVOICE PRINTS) its a...

Please recommend a open source orthogonal routing code such as LIBAVOID but in VB.net

It should be able to draw interconnection between two points in a Manhattan distance manner.It should also avoid overlapping other nodes and lines ...

Enable Sub Menus in VB.NET [#00001]

Hi, I have a problem and that is related to Menus in VB.NET. The problem is as follows: I have created a menu called "Test" and sub menus in that called "Test 1", "Test2", "Test 3", "Test 4" and "Test 5". The property "NAME" of these sub menus are "M1", "M2", "M3", "M4" and "M5". All these menus are disabled at runtime and in the MDI ...

How to store directory in varaibles

I am using following code to search a specific file with .doc extension. How can I get this info into a variable to be used later. Thanks Dim di As New DirectoryInfo("d:\") Dim files() As FileInfo = di.GetFiles("*.doc", SearchOption.AllDirectories) ...

What ways can I ensure that a string property is of a particular length?

I've created some classes that will be used to provide data to stored procedures in my database. The varchar parameters in the stored procs have length specifications (e.g. varchar(6) and I'd like to validate the length of all string properties before passing them on to the stored procedures. Is there a simple, declarative way to do th...

Error converting data type nvarchar to datetime.

Using Vb.net/SQL Server 2000 updating a row via a gridview/sqldatasource Stored proc: @ISTag varchar(10), @PCISTag varchar(10), @User varchar(50), @Date_Start datetime, @Date_End datetime, @Status varchar(50), @Cost money, @Notes varchar(500), @CreatedBy varchar(50), @ModifiedBy varchar(50) AS BEGIN -- SET NOCOUNT ON added to preve...

Specify v11 (with v11 & v12 installed) Microsoft.Office.Interop.Word

I am working on a legacy VB.NET application that uses Microsoft.Office.Interop.Word, with Office 2003 installed on the server. When I publish my site, even though my config file clearly shows v11: The site will crash saying v12 couldn't be found: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture...

Make An Integer Null

I have an update function that updates an sql server db table through a dataset. One of the fields in the table is an integer and accepts null values. So when I am populating the update function I need a way to enter a null in when the function wants an integer. I tried to do it this way but _intDLocation = "" throws an exception Dim ...

Make A Date Null

Can someone help me fix my code I am trying to put null in sql server through a function that is excepting _dtSWO. If I set _dtSWO = Nothing it returns #12:00:00 AM# which throws an exception. The field is nullable in sql server I just want it to return a blank Dim _swoDate As String = udSWOReceivedDateDateEdit.Text Dim _dtSWO...