vb.net

Why does inheriting a WPF Button change the appearance of the image in a toolbar.

Using the following code btn2 looks different to btn1 and btn3 yet they are using exactly the same image. Public Class MyToolBar Inherits ToolBar Public Sub New() MyBase.New() Dim bmp1 = New BitmapImage(ImageUri.DeleteItem) Dim bmp2 = New BitmapImage(ImageUri.DeleteItem) Dim bmp3 = New BitmapIma...

What is the use of ContextBinding in vb.net?

I am trying to bind nested object to a datagridview in vb.net. and somewhere i found referring me contextbinding. I searched but didn't find any good example and desription of it. can anybody help me with this one for binding nested class object to a datagrid Edited: to add link http://msdn.microsoft.com/en-us/library/system.windows.f...

SourceControl of ContextMenuStrip is Nothing in ToolStripMenuItem Click?

I have single ContextMenuStrip attached to more controls. In use the Opening event of ContextMenuStrip to filter/disable some context entries. In this case the property ContexteMenuStrip.SourceControl is set correctly. The problem I have is on the Click event of a ToolStripMenuItem. This item is inside a ToolStripDropDown. I get the ...

consume gsoap webservice from .NET client

From a .NET application, how do I consume a Web Service developed using gSoap c/C++ library? I can create a C/C++ client using gSoap library to consume the web service. But I need to consume it from within a .NET (C#) application. I tried Adding a Web Reference but that doesn't seem to work. Would I need to work with raw Soap Packets?...

Regex test for NUMBERS

I have found a Regex that test if the text passed to a TextBox is an email. If Regex.IsMatch(email.Text, "^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" + "(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$") _ Then // True End If I want to change thi...

How to programmatically modify My.Log settings configuration

Hello, we have several applications in Vb.Net using the built in log system (My.Log) to write log information. Until now this system was configured by the application.config file before execution but now we want to let the user to choose some options. Is there a way that does not requires to parse the XML file and process it? Is there ...

WPF Window Aspect Ratio

I'm wondering how to maintain the aspect ratio (i.e.: 16x9) of a window in WPF upon resize--if possible in a way that leverages MVVM. As I'm new to both MVVM and WPF, I'm not sure where to begin. Thanks. ...

Making specific text a hyperlink

is it possible to have specific text in a listbox line to act like a hyperlink? dim sLocation as string = "\\server\folder\subfolder\" LstOut.Items.Add("text text text" & sLocation) I would like this to open in explorer. This is not an ASP application, just a plain old winform. ...

Regular Expression - How To Find Words and Quoted Phrases

Hello, I am wanting to take a string of say the following: Guiness Harp "Holy Moses" So that in C# or VB get a match set of: Guiness Harp Holy Moses Essentially it splits on the spaces unless there are quotes around the spaces, then those words between quotes are considered a single phrase. Thanks, Kevin ...

Fastest way to write cells to Excel with Office Interop?

I am writing a function to export data to Excel using the Office Interop in VB .NET. I am currently writing the cells directly using the Excel worksheet's Cells() method: worksheet.Cells(rowIndex, colIndex) = data(rowIndex)(colIndex) This is taking a long time for large amounts of data. Is there a faster way to write a lot of data t...

VB.NET Strange sort behavior?

Hi, I've got a class with the following overload: Public Overloads Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo ' I want a logmile, darn it! If Not TypeOf obj Is Logmile Then Throw New ArgumentException If Me("beg_logmile") > obj("beg_logmile") OrElse Me("end_logmile") > obj("end_logm...

ContextMenuStrip not highlighting Items according to mouse movement

I have a ContextMenuStrip that I am showing programmatically in response to a button being clicked. Everything works as expected, except that the Items in the menu do not respond to being moused over. Whether the mouse button is up or down, mousing over the menu has no visible effect, and releasing the mouse button does not select an I...

How To Use LINQ To Find Matching Data Against A List Of Strings

Hello, I have a specialized string dictionary of (string, string) (_RulesAndTheirDescriptions) that contains the name (key) and description (value) of methods in a given class. I currently do the following query to search for a match on the key or value and then bind that to a grid. Works great! Dim Results = From v In _RulesAndThe...

Forcing Inf And Nan To 0 Vb.net Excel Interop

I am creating a report in my asp.net application. The report outputs to excel using the excel interop. Some calculations in the report cause excel to display "Inf" or "NaN" I want to force these calculations to zero so that the report displays zero and NOT "Inf" or "NaN" ...

vb.net remove a row in two-dimensional array

In vb.net how do you delete a row in a two dimensional array? ...

Formatting - add comma, 2 decimal places to cell values vb.net excel interop

Does anyone have any vb.net or vba code that will format excel values or a range of cells to have comma for 100s, 1000s,10000s etc.. and 2 decimal places only. i.e. 10,256.45 ...

Equivalent of RecordSet.MoveNext while Not EOF in ASP.NET

Hello, I'm using a DataReader to display informations stored in a table. I created Two button to go to next record and to go back. In VB6 I used this code : While Not Recordset1.EOF Recordset1.MoveNext End While In ASP.NET I didn't find a way to do like it, because DataReader hasn't the EOF property. EDIT : While Not Recordset1.B...

VB.NET: Attemp to initialize a picture despite ArgumentException "Parameter Invalid"

Hello, I am trying to convert a bit stream to an image and I get the "Parameter is not valid." Argument Exception. My bit stream is not null, but it is corrupted. I am wondering if I can try to ignore this error and still attempt to create and display the picture. Here is the code: Private fileByte As New List(Of Byte) Private picture...

putting a hyperlink inside of a label in vb.net

i have this in my vb.net code. label1.text = "Click on THIS ONE to proceed" Now for the THIS ONE in the label text i want to give it a hyperlink or response.redirect. Any ideas how i can do this? ...

Problem while connecting to DataBase ASP.NET

I have a database in the same workspace, I've tried to connect to this DB using this codes : Dim CX As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "./Learning.mdb") Dim CX As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "~/Learning.mdb") Dim CX As O...