vb.net

How to create a treeview with radio buttons in the [grand]child nodes?

I am trying to create a treeview that looks something like the following: Parent |__Child1 |__ __ __ O Grandchild1 |__ __ __ O Grandchild2 |__Child2 |__ __ __ O Grandchild3 |__ __ __ O Grandchild4 I am using vb.net in Visual Studio 2008. Any insights as to how I can accomplish this will be very much appreciated! ...

Why is it legal to pass "Me" ByRef in VB.NET?

I was shocked just a moment ago to discover that the following is legal (the C# equivalent is definitely not): Class Assigner ''// Ignore this for now. Public Field As Integer ''// This part is not so weird... take another instance ByRef, ''// assign it to a different instance -- stupid but whatever. ' Sub Assign(By...

Lost Focus method for asp.net textbox?

How to write Lost focus method for asp.net text method? Please anybody have any idea to write this, share with me? ...

Anybody ever tried to pass an operator as a value on a function?

Hi, the idea is simple The is a calculate function for example Function Calculate (Byval v1 as integer, Byval v2 as integer, byval op as ????????) as double return v1 op v2 End Function Anybody tried this? I don't want to use functions for every operation (multiply,divide, etc.). I wanna pass a operator same as I pass the values....

Looping through all directory's on the hard drive

Hey all i have this piece of code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strFileSize As String = "" Dim di As New IO.DirectoryInfo("C:\") Try di.GetFiles("*.*", SearchOption.AllDirectories) Catch End Try Dim aryFi As IO.FileInfo()...

Does VB.NET and Visual Studio 2010 support multiline anonymous method?

I found that this answer was asked and answered before VS2010 was actually released. They say that VB9 has only single-line anonymous functions. We're adding full statement and multi-line lambdas in VB10. But I tried to add this code Dim test2 = Function(t1 As T, t2 As T) ( Dim val1 As IComparable = DirectCast(prop.GetValu...

Finding out which instance of a form initiated another form or module

I'm trying to figure out the best way to reference a control on a form from within a module. Unfortunately the form is just an instance, so it's not as easy as calling form.control... Dim ChildForm As New frmSearch ' Make it a child of this MDI form before showing it. ' ChildForm.MdiParent = Me ChildForm.Show() That f...

The images in the gridview will not rendered

hello guys, i have a problem and hope that somebody can help me. i am developing in vb.net. i have a gridview with a template field, in which i have a asp:image tag. But the browser dont show any image. i does not render the image. if i check the sourccode in the browser there is no image tag. But the visual web developer show the imag...

Telling the difference between two large pieces of text

What would be the best way to compare big paragraphs of text in order to tell the differences apart. For example string A and string B are the same except for a few missing words, how would I highlight these? Originally I thought of breaking it down into word arrays, and comparing the elements. However this breaks down when a word is ...

Monitor process output without stealing it from the shell

I have a shell program that sends output to standard out and standard error. I am trying to write a program in VB.net which inspects the output in real time and presents summarized information in a GUI. I also want the shell program to continue to display its output in a command prompt as usual. I don't want to just shove the output in a...

The parameterized query expects the parameter which was not supplied.

hi im having a problem with my code Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged list.Items.Clear() cmd.CommandText = "SELECT * FROM borrow where (Department LIKE '%" & TextBox2.Text & "%')" cmd.Connection = con cmd.CommandType = CommandType.Te...

Vista Style DropDownMenu with TrackBar

In Windows Vista/7's windows explorer, the Icon Size selector has got a track bar in the DropDownMenu (see Fig. 1) Fig. 1: DropDownMenu with TrackBar in Windows Vista Does anyone know where I can get a similar UserControl or show me how to replicate it in .NET? NOTE: If anyone's wondering where the image came from, I captured it from...

Weird situation with Empty String

I have code to parse Date Field only if String is not null or empty but I get the following Exception Conversion from string " " to type 'Date' is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it ori...

How will an object with a value type and reference type be stored in .NET?

In .NET, integer data type is a value type(stack) and String is a reference type(heap). So If a class A has an integer, and a string type object in it, and a class B creates an object of class A, then how will this object of class A be stored in memory? In stack, or in a heap? This was asked in my Microsoft interview. Need to understan...

For...Next loop only works on initial step

VB beginner here. My For... Next Loop will not work and I cannot for the life of me figure out why. I have tried to display the results in a label and a text box with multiline enabled. Doesn't seem to matter. It's probably something obvious I have been overlooking for 2 hours. Thanks in advance for any help. Option Explicit On Opt...

VB.net UnitTesting - Report Progress

Hello, Is there currently any possible way to report progress of my unit test? I have a test that could take up to a hour, and I don't want to sit there not knowing what % it is done with. I have tried writing with debug.print and trace.writeline, neither of which seem to work. Thanks in advance, Anthony F Greco ...

Using For Each loop with a Where Clause for XElement

Hi, I am tring to write a for each loop that loops through the descendants of an xml doc but only the ones that satisfy a criteria. I thought i would be able to do this with the where clause but i am having problems with this. It would be great if someone could let me know if this is actually possible or if there is another way i could...

How to handle DateDiff if one date is blank?

How can we handle the case where one date is blank in DateDiff method? Example: DateDiff(DateInterval.Day, CType(txt61_2.Text, Date), CType(txt21_2.Text, Date)) In above statement fields txt61_2.Textor txt21_2.Text may be empty then take it has 0 Please let me know how to manage this? ...

beginner question, calling a function/assign property etc... of an object inside an array

So if I create an object test, and it has a property color. When I add this object to an array list I typically can access this using myarray(0).color but intellisense doesn't 'know' that I have a 'test' object inside the array. It would let me type myarray(0).whatever but would then crash if I made typo. It seems like I should be able t...

Avoiding cross process calls when doing Word automation via VB.net

The short version I've got a Word Addin in VB.net and VSTO that exposes a COM compatible object via Word.COMAddins.Object, so that the addin functionality can be called External to Word, without accesses to Word itself being cross-process. The technique worked in VB6, but with VB.net, it still works, but it's much slower than the same c...