Questions tagged [vb.net-2010]

The version of Visual Basic .NET used in Visual Studio/Visual Basic 2010. Use VB.NET and Visual Studio 2010 tags instead unless the question is specifically about language features added in VB.NET 2010.

The version of Visual Basic .NET used in Visual Studio/Visual Basic 2010. New features include:

  • Less-strict line continuation; for example, this syntax is allowed:

    Dim lines() As String = {
        "I am line number one",
        "and I am line number two."
    }
    
  • Auto-implemented properties. This:

    Public Property Hello() As String = "World"
    

    is compiled like this:

    Private _hello As String = "World"
    
    Public Property Hello() As String
        Get
            Return _hello
        End Get
        Set(ByVal value As String)
            _hello = value
        End Set
    End Property
    
  • Collection initializers using From:

    Dim l As New List(Of String) From {"Hello", "World"}
    
  • Multi-line lambdas:

    Call New Thread(Sub()
                        Console.WriteLine("Hello, world!")
                    End Sub).Start()
    
  • Support for dynamic types

  • Support for contravariance and covariance

The full list of changes can be found here.

2117 questions
3
votes
1 answer

Multiple windows handling with VBA and VB.NET API

I'm trying to use API with below VBA code, but there are multiple windows handle with same caption and class name like "#32770" and "Button". So, how can I move on to next handle. I have attached the screen shot of spy registry values I wanted to…
SmithG
  • 31
  • 2
3
votes
4 answers

To sort a class array in vb.net

I have spent 2 days scouring the internet trying to find the solution to simply sort an array made up of a class of strings and integers (by just 1 of the string elements that may contain irregular characters). Please help! I have created a…
James
  • 33
  • 3
3
votes
1 answer

What does SaveChanges() exactly do in EF6?

I'm trying to understand transactions in entity framework 6.. I searched a lot but I'm still confused.. Take a look at this: Dim transaction = context.Database.BeginTransaction() Using transaction . . context.Entry(entity1).State =…
Abeer Sul
  • 944
  • 9
  • 22
3
votes
1 answer

Click button in WebBrowser control vb.net

I am trying to click the button highlighted in picture below. The code is from a web page: I'm not to sure, but I believe the button is within an iFrame. I have tried: Dim wrapClick As HtmlElement =…
Jack
  • 45
  • 1
  • 5
3
votes
1 answer

Can we use TypeIdentifierAttribute in .NET without COM?

I am curious if it is possible to make 2 interfaces in .NET (either in the same assembly or in separate assemblies) that can be treated as equivalent, using the new TypeIdentifierAttribute attribute. I have not found a way. I've seen some stuff on…
Mafu Josh
  • 2,523
  • 1
  • 23
  • 25
3
votes
1 answer

Window that is supposed to be fullscreen in WPF touchscreen application is moving when inner listbox is scrolled

I am writing a GUI application to run on a touchscreen device using VB.NET and WPF--it must be full screen at all times, like a kiosk app; the window must not be able to resize or move in any way. The window contains a ListBox that users can…
Mr.E
  • 47
  • 1
  • 7
3
votes
4 answers

What is the benefit and a common real-world practical application of using Tuples in .NET 4.0?

I have read about the Tuples provided with the coming-out of the new .NET Framework features, and still am I wondering about how it could be useful in real-world enterprise applications. Can one give me a brief explanation along with a simple but…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
3
votes
2 answers

How to change text of chart annotation

I would like to change the text of my TextAnnotation in a chart. However, I can't find the .Text property in chart.Annotations("annoRent") .I know it is because I haven't specified it is a TextAnnotation. How do I do that?
Nick
  • 33
  • 1
  • 5
3
votes
1 answer

Strong Naming an assembly using command line compile

I am trying to use NAnt in order to compile and sign an assembly using the vbc compiler. I have a project set up and am able to successfully sign the assembly compiling with VS2010. When I try to sign it using the command line I get this…
BlackICE
  • 8,816
  • 3
  • 53
  • 91
3
votes
1 answer

Identifying if a JPG file is open

I've been trying to set an error trap that will detect if a file is already open. This is no problem when the file is a text file using the following code: Private Function FILEOPEN(ByVal sFile As String) As Boolean Dim THISFILEOPEN As Boolean =…
3
votes
2 answers

VB.net Excel.worksheet().cells().Value

Trying to write information in Excel worksheet But have some strange problems ;) i looked info on Google but no result.. So plz help ) I Add reference Microsoft.excel 14.0 Object Library and also Import Microsoft.Office.interop I need to get Value…
Niarah
  • 33
  • 1
  • 1
  • 4
3
votes
0 answers

Microsoft WindowsAPICodePack - Could not load file or Assembly

I have developed my vb.net application. I have used Microsoft.WindowsAPICodePack.dll and Microsoft.WindowsAPICodePack.Shell.dll as reference. I have build my application as Release. I have the below mentioned files in \bin\Release folder. File…
user3428095
  • 61
  • 1
  • 4
3
votes
1 answer

HOW - Detailed Folder Browser - VS 2010

I know how to browse folder with dialog. But when I use bellow code: Dim FBrowserDialog As New FolderBrowserDialog() FBrowserDialog.Description = "Get Folder" FBrowserDialog.RootFolder =…
user3428095
  • 61
  • 1
  • 4
3
votes
2 answers

Maximize Print Preview?

Is there any way to Maximize the Print Preview Dialogue? I could not see any Maximize property on the controls at properties window.
Graham Jones
  • 165
  • 4
  • 19
3
votes
5 answers

Why doesn't Visual Studio debug my VB.NET application?

I recently have encountered a weird issue with my project: as soon as I click debug and it builds the project, it stops debugging. There isn't any error message, or anything else that comes up, including the form itself. I've tried messing with the…