vb.net

Parent/Child Relationships failing when getting data from parent class, with multiple forms open

I have a main form, and some sub forms, and each sub form can have some sub forms. When I have multiple sub forms open, and I try to get data from the parent form, it returns the data from the wrong parent form. For example I have two instances of Mainform.subform running. If I do something like this in a child form of one instance of t...

Some kind of error, Possibly When Viewing a Windows Form in the Designer

Hi all, I though I had solved this problem, but it is back: Code generation for property 'SelectedPeople' failed. Error was: 'Type 'ECS.Entities.Persistency.Person' in Assembly 'ECS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.' The property on the error message is a List(Of Person) and for som...

Why does VB have more LINQ keywords than C#?

Why does VB have more LINQ keywords than C#? ...

What is "ShowWindow Lib "user32" " about?

I was looking over some code that another developer wrote and found this: Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer Private Declare Function SetForegroundWindow Lib "user32" (ByVal handle As IntPtr) As Integer What does it do and what is it for? ...

Is there a way to make a value accessible only to the parent of a nested class VB.NET?

In general, according to the OOP paradigm, my understanding of encapsulation basically says: If a member is private, it can only be accessed by the class. If a member is protected, it can only be accessed by the base class and any derived classes. If a member is public, it can be accessed by anyone. If I have a nested class, can I de...

Can Visio's macro warning prompt be surpressed when automating in code?

I'm automating Visio 2003 from a VB.NET app. My code looks like this (with the uninteresting stuff removed): Dim objApp As New Microsoft.Office.Interop.Visio.InvisibleApp objApp.Settings.ShowFileOpenWarnings = False Dim objDoc As Microsoft.Office.Interop.Visio.Document objDoc = objApp.Documents.Open(VisioFilename) I've found that the...

Parse a string to a specified length (without cutting words)

I have a long string that I need to parse into an array of strings that do not exceed 40 characters in length. The tricky part of this for me is making sure that the regex finds the last whitespace before 40 characters to make a clean break between strings since I don't want words cut off. ...

Implement Unit Testing on a legacy web site

Hi All, I downloaded nUnit and TestDriven.net. I have a legacy Web Site application and I would like to implement some unit testing. I created a class in the app_code folder and added Imports NUnit.Framework etc... After writing a basic test, I get the "Can't execute tests in 'Web Site' application." error. I guess the Web Site project i...

How to ignore password protected excel sheets programmatically.

With my Tool we are scanning excel files and generating reports. My problem is some excel sheets are password protected and getting pup-up while scanning and it halts the Tool to run further. Could someone let me know the solution, how to overcome with this problem. I just need to skip the sheet and continue with scanning without any us...

Inheritance Question

I have a base class, "B", which has two constructors, one with no paremeters and the other that accepts one param, an integer I have a subclass, "S", which inherits from "B" and does not define any constructors in it. I create an instance of S, attempting to pass to the constructor an integer. I get the error: Error 1 Too many argume...

ListView Selection Rectangle in VB.NET

How can I temporarily disable listview selection rectangle, so when someone clicks the listview and holds the button down & moves the mouse, the rectangle is not shown? And how do I enable it again after that? (VB.NET) ...

Using Access 2007 Queries From VB .NET

I have a access database setup which i am connecting to via ODBC, the access files already has all the required queries built and i would simple like to call them from within my application. I am using Visual Basic .NET and this is what i have tried so far..... Thanks in advance for any help you can offer. Ben Dim command As ...

Where and when is InitializeComponent called in Windows Forms control in VB.NET?

I'm doing a Windows Forms project in VB.NET, but VB.NET is completely new to me, I'm primarily a C# developer. In C# Windows Forms/User controls InitializeComponent is called from the form's/control's constructor. When I create same scenario in VB.NET I don't get a constructor and I can't locate a place where InitializeComponent is call...

Help with Infragistics ultragrid cells - manipulate text property?

Hi, I'm having trouble with an infragistics ultragrid using vb.net. I currently have a cell with the value "inner", however I want to be able to display a completely different string for that cell without losing the value. I understand that the cell has two properties, one value property and one text property. The text property is read-...

How to select multiple folder path usingt FolderBrowserDialog control in vb.net

Is it posssible to select multiple folder path from browse dialoge box in vb.net? Please let me know if there is any link or reference. Thank you. ...

Is a code only ASP.NET Header and Footer possible?

I have a global header and footer that has a Database connection and a disconnection in the header and footer and need to convert this to ASP.NET - this needs to be done before any HTML is output and after any HTML is output for the footer. I cannot seem to find any easy way to do this, like in Classic ASP - if possible post an example o...

VS 2003 reference problem

We have inherited a vb.net 2003 web project, it seems to reference another web site. I am not sure how this was done. I cannot delete the reference (there is no properties and will not respond to pressing the delete key). The reference looks like a folder with a pic of the world on it. Any ideas how to get rid of it? Thanks ...

How can I write to my own app.config using a strongly typed object?

The following code has two flaws, I can't figure out if they are bugs or by design. From what I have seen it should be possible to write back to the app.config file using the Configuration.Save and according to http://www.codeproject.com/KB/cs/SystemConfiguration.aspx the code should work. The bugs are shown in the source below and appe...

Displaying controls based on radio button selected

I have a group of three radio buttons. Depending on which radio button is selected, I want to disaply one of three controls - a textbox, a dropdown list, or a button. How do I display controls based on the result of a selected radio button? ...

Custom Checkbox list control Error in asp.net. "startIndex cannot be larger than length of string"

I am creating a custom checkbox control to add a div after each checkbox in a checkboxlist. The class is below. Imports System.Web.UI.WebControls Imports System.ComponentModel Imports System.Globalization Public Class MyCheckboxListCheckBox Inherits CheckBoxList Implements IRepeatInfoUser Protected Overrides Sub RenderItem(...