vb.net

Inspector.WordEditor is Nothing (Null)

I have an add-in for Outlook 2007 developed with VSTO 3.0 in Visual Studio 2008, written in VB.NET I am listening for NewInspector events and wrapping the Inspector object, then listening for the Activate event where I attempt to grab the WordEditor. The property is always returning null now. This was not happening before, and the only ...

How do you run another .exe from VB.NET as another User?

How do you run another .exe from VB.NET but as another User? I expect to launch a .exe like "Left Click -> Run As -> Enter User/Pass -> Click OK" If I do that, my application runs as expected (I need to run it as another user to get access to some folders in the network) But if I use this in VB.NET System.Diagnostics.Process.Start(Syst...

How do I make WPF case-insensitive?

I dislike WPF's inability to interpret text in a case-insensitive way. Are there any tools (i.e. VS plugins) out there that will take my VB .NET code and handle the case-sensitivity issues for me? Edit: Now with examples. Input: <Dockpanel DockPanel.Dock="Bottom"> <Label Content="(c) blahblah" HorizontalAlignment="Left" Name...

populate checkboxlist from sql db in vb.net

I have a checkboxlist in aspx as following. <asp:CheckBoxList ID="new1" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"> <asp:ListItem>A</asp:ListItem> <asp:ListItem>B</asp:ListItem> <asp:ListItem>C</asp:ListItem> <asp:ListItem>D</asp:ListItem> </asp:CheckBoxList> In the table in sql server database, the ...

Substring size advice

If using the following in an if statement I get an error: If trg.Name.Substring(4, 6).ToUpper <> ("ABCDEF") Then I get the error: "Index and length must refer to a location within the string. Parameter name: length" I assume this is because the string (trg.name) is too small for the 4, 6 substring. What would be the correct method of...

Where do ASP.NET "website prejects" store default reference/assembly settings for VB/C#?

MY understanding is like this, for the "website type" of projects: for VB, the default setting for the namespaces and the default setting for references are both stored in C:\Windows\Microsoft.Net\Framework\V4.0.30319\Config\Web.config. but C# does not seem to use this global web.config file to store its default namespaces and referenc...

.NET 4.0 framework dynamic features in VB with Option Strict On?

Is there any way to use the new dynamic features in the 4.0 framework like ExpandoObject in VB.NET without setting Option Strict Off? With C#, you lose type safety only with the variables you specifically declare as dynamic. But with VB, the only way I've found to use these features is with the old Option Strict Off trick that's been in...

Form loses focus after clicking button

when clicking on the start button in the code below, the form seems to lose focus and I need to click the stop button twice to stop the count. (First click to activate the form, second to click the button) Can someone please explain this behavior or offer a better alternative? Public Class Form1 Dim testrunning As Boolean Priv...

Get Items from xml and add to listview

I am trying to add get items from an xml document and load it into a listview. I keep getting an System.OutOfMemory exception on the line projects.Add(project). What am I doing wrong and how do I do it correctly? I got this code from murach's beginning visual basic.NET. When I run this it adds random spaces between the items in the listv...

How to set label backcolor in VB.Net

Here is the code : Chess(z).BackColor = #FFFFFF It is not working, how to make it work :)) ...

Migrating Stored Procedures into application

All of those disadvantages of stored procedures (database portability etc.) I am now facing. We are going to migrate our VB.Net/ASP/SQL Server application to something like Mono/Postgresql and fully internationalize. One of the many issues we face is that we have 800-900 stored procedures. What we are thinking of doing is moving the log...

Why this code not work

Public Class Form1 Dim i = 0 Dim re = True Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick If i = 225 Then re = False ElseIf i = 0 Then re = True End If If re = True Then i += i ElseIf re = False Then i -= i...

csv column contain mix datatype connot read all cell data using oledb provider

hi my csv contain mix datatype f.ex. in cell E8 data format is date, and other data in this E column are string. i use this connetion string in classic asp ,VB Script and back end SQl server ChekCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Path1 & ";Extended Properties=""text;HDR=YES;IMEX=1;FMT=Delimited""" Set rs1 = ChekC...

Enabling CTRL+Z property in masked edit textbox using VB.Net

Hi all, I am using a masked edit text box in my windows application that was developed by using vb.net. In normal text boxes (CTRL+Z- to revert back to original value) is working fine. But In case of Masked Edit Textboxes its not working fine. Can any one please help me about this. This ctrl+Z should provide the functionality as same...

Handles keyword dissapears on control cut/paste

When I cut some controls in designer window and paste them in some other container, handles keywoards dissapears from code. If I have btnOK on form and click event handled like this: Private Sub btnOK_Click(...) Handles btnOK.Click and then in designer I cut the button and paste it somewhere else, Handles part just disappears, living...

Transferring data from one field in a table in a database to another field in a different table but same database in VB.NET

I am creating a database in VB.NET for a movie rental place. I currently have three forms; Member Information DVD Information Borrow DVDs What I would like to do is when I am viewing a member's details, if I click a button 'Borrow DVD for Member', the member's ID number transfers over to the Borrow DVDs table in the Member ID which a...

WindowLicker for .NET's WinForms?

Is there anything like WindowLicker(a GUI test framework) but for .NET's WinForms? Thanks ...

Database advice needed: porting VB6/ADO/JET app to VB.NET

I need to update (well, rewrite really) a SMALL VB6 application which uses ADO to access a JET database, to a vb.net app in Visual Studio 2008. My research suggests that I should use LINQ, but it doesn't seem to be possible to connect to JET. If JET is now deprecated, what should I use? Or should I use ADO.NET without LINQ? Please don'...

[VB.Net] ByRef vs ByVal performance when passing strings

Hello everyone! Reading http://stackoverflow.com/questions/408101/which-is-faster-byval-or-byref made me wonder whether the comments in there did apply to Strings in terms of performance. Since strings are copied before being passed, isn't it much more efficient (if the callee doesn't need a copy of string course) to pass strings ByRef?...

How to disable windows startmenu using vb.net?

I am trying to disable windows start menu key and Control+Esc and Alt-Tab for a Quiz project. Where user cannot press Startmenu. I was successful in disabling Ctrl+Alt+Del and Ctrl+Shift+Esc. OS is XP. ...