vb.net

My custom WPF RIchTextBox will not accept user input, even after setting IsReadOnly=false

I have written a custom Bindable RichText Box, so I can bind to the Document property. However, as soon as I set my document content, the only keyboard input it accepts is the backspace key (???). No other keyboard input is acknowledged (including the arrow keys). Any ideas? Here is the code of my BindableRTB class: Imports System.W...

datagridview apply cellstyle to cells

I used this example to create a DateTime column for a DataGridView in my winforms app. http://msdn.microsoft.com/en-us/library/7tas5c80.aspx I can see the new column in the Windows Forms Designer and add it to an existing DataGridView. However, I want to be able to change the display format when I change the "DefaultCellStyle" within t...

What are some useful sites for VB .NET programmers?

Lately I've had to do a bit of programming in VB .NET. It hasn't been too difficult, but the lack of proper documentation or good tutorials has been annoying me. I'm used to finding a lot of relevant info when I google a programming question, or term, or method name - but it's been more difficult with VB .NET. Anyone know of any good tut...

dynamically varied number of conditions in the 'where' statement using LINQ

I'm working on my first project using LINQ (in mvc), so there is probably something very simple that I missed. However, a day of searching and experimenting has not turned up anything that works, hence the post. I'm trying to write a LINQ query (Linq to SQL) that will contain a multiple number of conditions in the where statement separa...

[WPF and VB.net] load <document> node from XML into documentviewer control upon selecteditemchanged in treeview?

This is driving me absolutely nuts. I've got a WPF browser application that is somewhat like a content management system. We're going to use it for internal employees to get troubleshooting documentation. It consists of a Treeview, to hold all the topics, and a documentviewer control to display XPS documents. Currently, I have XML th...

Create a Icon from a Resources.resx

I have a Icon(.ico file) in the (VB.NET)MyProject>Resources.resx file. How do I extract it in run-time as a Icon object? Thanks ...

Cloning the WPF ComboBox control: Ideas or suggestions

If have a control that acts like a record selector from a database, say, for example, customers. The control must act in certain ways allowing the user to type the name, the alias or the code of the customer, and the control will select the correct one, or offer a list of possible candidates, and other behaviors. I have tried to inheri...

Tips for debugging likely Crystal Reports hang in ASP.NET

Attempting to keep this short: our shipping personnel use a Windows Mobile-enabled barcode scanner to scan the serial numbers of items shipped on customer orders. That data is submitted via asmx web service and a report is automatically printed to a networked printer showing customer info and the details of items shipped. All of this h...

Show Selected Item in Listbox (System.Web.UI.WebControls)

I'm working with a listbox that has, let's say, 20 items. The size of the listbox allows the user to see the first 5 items. However, the listbox has one preselected item which is sometimes not visible because it isn't one of the first 5 items. After I set the selected Item for the listbox how can I ensure that the lisbox is scrolle...

LINQ-TO-XML using UNION

I am trying to union to queries to create an XML file. The query itself works as T-SQL, but my implementation as LINQ-TO-XML fails with "Could not translate expression..." error. Am I asking the wrong question? Is this approach flat wrong? I am new to LINQ. How do I create a single XML from 2 queries? Dim db As New SOMEDataContext Dim...

Question about VB.NET constructors

I'm doing a lab for school, and I came across something I have never done before: create a default constructor within my class. It involves creating a private field to store the connection string, then create a default constructor that sets the connection string. Here is what I have so far: Public Class Appointments Private sqlcon...

Executing a VB.NET DLL From SQL Server

Objective: we want to write a DLL using VB.NET 2008 using .Net 3.5 that performs an HTTP request we then want to call the DLL From SQL Server 2005 (in a trigger) and pass the DLL some variables and get a return value. Where im at in the process. I have created the DLL 'HTTPDLL.dll' Source: Imports System Imports System.Configurati...

Lack of block comments in VB .NET?

Just a question of interest: Does anyone know why there's no block comment capability in VB .NET? (Unless there really is - but I've never yet come across it.) ...

database for vb.net and asp.net

hi... is it possible to use same database for both vb.net appplication and asp.net?? and if is possible, how can to connect it??? now..i'd build vb.net application and asp.net in my laptop... it can connect..but i wonder how to make the database connect for vb.net and asp.net in real... thank you in adnvance ...

Comparing Hashtables in vb.net

I have a type of object called Bin, which has a hashtable field called Attributes. Like so: Public Class Bin Private _attributes As Hashtable Public Readonly Property Attributes() As Hashtable Get Return _attributes End Get End Property End Class If I have two bins, I'd like to compare if they...

What does [String] mean in VB.NET?

Does anybody know what does the following construct mean: Dim s1 as [String] What do the square brackets mean? And why does the following statement with Integer fail while the one above, with String works? Dim i1 as [Integer] Thanks in advance. ...

VB.NET Select Case Compiler Optimizations?

Does the VB.NET 2008 compiler selectively optimize Select Case Statements? For example, a Select Case Statement with a sufficient quantity of integer cases could be organized as a binary search. I ask this because I am curious whether or not I should opt for a Select Case in place of If Statements with multiple Else If's where integer...

Generating Excel through .Net doing odd things

Good Morning, I have a rather odd thing happening with an Excel WorkSheet that I am creating through .Net. I load up an existing workbook Dim _xlApp As New Excel.Application Dim _xlWorkbook As Excel.WokBook = _xlApp.Workbooks.Open(_templateFileName) set it to be visible before populating it (for debugging purposes) _xlApp.Visible = T...

vb.net string concatenation string + function output + string = string + function output and no more

The following output produces a string with no closing xml tag. m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString() + "</G3Grid:Spots>" This following code works correctly m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString() m_rFlight.Layout = m_rFlight.Layout + "</G3...

What is the most annoying / strangest thing that has happened to you using Excel Interop

Hi All, After developing using the Excel Interop with .Net for a while, i have become increasingly annoyed with the how many "odd things" happen - such as this question i posted earlier - My Problem. I appreciate that this is not a direct question and more of a collaberation of experiences, but i do think that it would be helpful how...