vb.net

Winforms and VB.net without knowing the basics

Can one learn programming in VB.net using Visual Studio (Winforms stuff) and never learn what a console "hello world" looks like or how, in code, to change which part of the program starts at execution (and other basic things like that) and still be a successful VB.net programmer? Or are there roadblocks just waiting there to be hit? ...

Whats the problem with my generic collection?

I wrote a class which imports System.Collections.ObjectModel. For the management of the collection, I've written: Default Public ReadOnly Property Item(ByVal vntIndexKey As Integer) As ItemType Get Return CType(mCol.Item(vntIndexKey), ItemType) End Get End Property Then when i was debugging, I was told: ...

How can I export trace.axd to a file

Hey, This probably has an easy answer, but I haven't been able to find one yet. I was wondering if there was a simple solution to exporting the page-level trace results of trace.axd to a log file of some sort. Thanks ...

Loading GIF freezing sometimes

I'm trying to use a loading overlay on top of a Windows form that adds a 50% opaque layer on top of a windows form with a loading GIF, while it does what it needs to do in a background thread. The overlay is a windows form that I'm drawing in the onPaint event. The loading overlay works fine on multiple different form loads, but fails ...

How can page events be handled from a usercontrol? (VB.net)

I would like some code to execute at the "preload" stage of my usercontrol's lifecycle. However the preload event is only available on the Page object. So, I added the following method to my usercontrol: Private Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Page.PreLoad However, I know get the compile...

Linq To Objects Auto Increment Number

This feels like a completely basic question, but, for the life of me, I can't seem to work out an elegant solution. Basically, I am doing a Linq Query creating a new object from the query. In the new object, I want to generate a auto-incremented number to allow me to keep a selection order for later use (named Iter in my example). ...

VB.NET and OOP - Shared Methods and Base Properties

If you can't use Me. in a non-instance method, how would you use properties/functions from a base class in a Shared method? For example, ClassB inherits from ClassA ClassB has a Shared Method DoWork(); ClassA has a ReadOnly Property SecurityKey How do I … Public Sub DoWork() Dim test as String = Me.SecurityKey End Sub ...

How to display text string in user control at design time?

I am creating a user control that contains a panel as well as 4 string and integer properties. I would like to display the text of the properties in the user control during design time. How do I do this? I am having a hard time finding examples. ...

How do you specify what file in a directory will load up asp.net

Rudimentary folder structure: <root> ---<admin> ------index.aspx ------[other files] ---index.aspx When I navigate to mywebsite.com/admin/, all I get is a directory listing. How can I get it to load up index.aspx automatically? ...

How do I bind a tree control to a data source in VB .NET?

Edit: Duplicate I'm new to .NET, and I've taken on a small work project, converting an existing VB6 product to a current version of VB (its either that or learning VB6!). This product is an internal desktop application (not web-based). I need to create a new tree view, that is linked to a particular table. Each row in the table ha...

Is it possible to develop a chat plugin like Gtalk for outlook?

My company uses outlook as the email client and we login to an exchange server. Out address book (not individual contacts) has all the users connected to our company network. Our company dont have IM ;-( .. I am thinking about developing an outlook plugin like Gmail's Gtalk . is this possible(technically)? Or how difficult it is? Will ...

How do I unload all open forms in VB.NET?

In the middle of converting VB6 code to VB.NET, I need to replace the following code that intends to close all open forms remaining in the application. 'close all sub forms For i = My.Application.OpenForms.Count - 1 To 1 Step -1 'UPGRADE_ISSUE: Unload Forms() was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local...

.NET Make xml more readable

Is there any way to take an xml string in .net and make it easyer to read? what i mean is can i convert this: <element1><element2>some data</element2></element1> to this: <element1> <element2> some data </element2> </element1> is there any built in class for this? as sql server 2005 seems to remove all formatting on...

Same random number generated when run in test Fixture setup

I am trying to generate a random number during testing using NUnit, but it keeps generating the same number. I am using the following function for this purpose. dim dCount As Integer = Math.Floor((High - Low + 1) * Rnd() + Low) dim divName As String = "abc" & dCount Any idea why it is doing this? Regards, Sam ...

Sharepoint errors

I have created a .net web part and deployed it on the sharepoint site. When I preview it, the sharepoint throws up an error saying "An error occured when previewing the Web Part" The code in the web part is as follows Dim myweb As Microsoft.SharePoint.SPWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(Context) ...

How to capture response from Cancel or Ok Button in two different Applications?

With my Application (vb.net) I am trying to scan Excel files some of which have ActiveX Components. When running my Application, I am getting a pup-up window in Windows Vista Environment with Office-2007 having button OK and Cancel button to proceed. But my problem is the scanning is not proceeding even after I keep on pressing the OK...

Is Collection(Of T) a 0-based array or 1-based array?

If it's 0-based, how can we add a placeholder to make it 1-based? Thank you. ...

How do I set the Font color of a label to the same as the caption color of a GroupBox?

I want to have some labels on a form with the same font color as the caption on my group boxes, and furthermore I want these colors to change if the user has applied a different Theme on their system. Can I do this without changing the GroupBox caption from its default? UPDATE: I have tried setting the Label ForeColor to ActiveCaption...

Please help me create a regular expression to parse my SQL statement

I want to extract FROM codes WHERE FieldName='ContactMethod' and IsNull(Deactived,'') != 'T' from SELECT FieldDescription,FieldValue FROM codes WHERE FieldName='ContactMethod' and IsNull(Deactived,'') != 'T' order by fielddescription using a regular expression. I have a regex like this: \FROM.*\order which extracts FROM cod...

Iterate thru DataRepeater (VB.Net PowerPack)

I am using the winform datarepeater control from vb.net power pack. All of the items on the repeater are readonly except for a checkbox column. I want to iterate over the items and find out which checkboxes are checked. I can't find a collection of datarepeateritems on the control and help is scarce. Thanks for the help. ...