vb.net

How to define a relative path for 'Start external program' in VS 2010 project?

I know that here there is a duplicate but I would like, if possible, to be able to define a relative path for 'Start External Program' or any workaround that do not constrain me to add a complete new empty project to my solution. I am using VB.NET in Visual Studio 2010 environment developing WinForms apps. ...

Specify an Inline Array to Custom Attribute in VB.NET

I would like to know if there's any way to specify an inline array (lets say of strings) to custom attribute on a property in vb.net. I have the following example that doesn't compile in vb.net (.net 1.1): Attributes.ManyToOne(New String() {"a", "b", "c"})> _ Public Property PaymentTerms() As PaymentTerms The attribute is defined in ...

Need to pass a querystring variable in MVC, so i can use it with jquery?

SO i would like to create this url blah.com/preview?h=yes so i can do this <% if request.querystring("h") = "yes" then %> jquery stuff <% else %> don't do jquery stuff <% end if %> ...

Why is my thread not starting immediately?

Hi, see below program. I start a new thread x with function abc, then I do some longer task. Why does x only start after end sub? Shouldn't it start right-away, before sleep ? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim x As New Threading.Thread(AddressOf abc) ...

directoryservices.directorysearcher loop has error A column named 'cn' already belongs to this datatable

I have a function that searches AD for members of various groups. If I remove the loop, I don't get the error "A column named 'cn' already belongs to this datatable", however, I need to iterate through each OU. Function getCOMDLNames(ByVal searchStr As String) As DataTable Dim MySearchRoot As DirectoryEntry = New DirectoryEntry("pat...

Why we use flush parameter with Encoder.GetBytes method

This link explains the Encoder.GetBytes Method and there is a bool parameter called flush explained too . The explanation of flush is : true if this encoder can flush its state at the end of the conversion; otherwise, false. To ensure correct termination of a sequence of blocks of encoded bytes, the last call to GetBytes ca...

Design time exception not caught in .Net Winforms

I have a form that is used at design-time to configure various properties. I've tried two ways to do a form-level catch all exception: (1) I add a handler to Application.ThreadException in the constructor. (2) I wrap the Show method, of the form, in a Try/Catch block Both of these work at run-time when I test by adding a property gri...

BitBlt function produces empty bitmap when compiled for x86 in .NET 2.0 VB app.

Hi All, I have a BitBlt wrapper function in my VB project. It works just fine when compiled as Any CPU, but when I aim it at x86 it creates an empty bitmap. I must use x86 as other parts of the app require it. Any ideas what could be wrong? Here is the code: Imports System.Drawing.Imaging ''' <summary> ''' Provides the static meth...

How to Change Grouping of Radio Buttons in Visual Basic 2010 Express Edition

The app I am trying to make needs a few info in the beggining, these questions include a radio button I have four radio buttons in the same frame and I want to change the grouping so there are two questions being answered ...

print gridviews, datagrids, or datatables

I'm looking for a solution to implement in web apps where I have the option to see a print preview or print either a gridview, datagrid, or datatable or export it to word or excel. What's the best method to do this or has someone written a class that does this, and does it well (I've seen many examples, but many still have errors)? ...

Slow DataGridView Drawing\Rendering

Hi, I'm using a DataGridView to load data from a DataTable. This DataGridView is located on a tab (Forms.TabPage). When clicking this tab the datagrid takes a second or two to draw from the top down, regardless of wheather data is being loaded or not. Is there anything I can do to speed up the Drawing\Rendering when clicking the Tab?...

How do I make an image follow the cursor even outside an application?

In VB.Net with Winforms how do I make an image follow the cursor even when it leaves the form? I want to do this during a drag and drop operation. BCL and/or GDI is better for my usecase than P/Invokes. If you are familiar with PeaZip, it does something of this sort when dragging a file from it's interface. ...

Calling browse file window of fileupload control...

I have an ImageButton and a FileUpload controls in a child page of a master page. I would like to achieve something like when user click on the ImageButton, the browse file window will pop-up like what we did when we click on the Browse button of the FileUpload control. How can call the browse file window of the FileUpload control when ...

Access js localStorage stored value in VB.Net

I have a login page that stores a few values to localStorage (html5) then continues to a VB.Net page. I am looking for a method in VB that can read back those stored values and make them VB vars. Any ideas? ...

How to pass page or master page object to AJAX page method

I wrote a page Page method in my aspx page. in web service method I need to call FindControl method return textbox and get text box value. But my findControl will take MasterPage object to iterate. Please see my code <script type = "text/javascript"> function ShowCurrentDateTime() { $.ajax({ type: "POST", ...

Returning subset of dictionary with a complex type as a key with Linq

I have a collection as follows Private _bankRates As Dictionary(Of RateSourceBank.Key, RateSourceBank) Where RateSourceBank.Key is simply Public Class Key Public RateType As String Public EffectiveDate As DateTime End Class How can I retrieve a subset of _bankRates that have more than one EffectiveDate per RateType? Unf...

Nhibernate mapping of System.Drawing.Image

Question: I get an exception serializing this class to a nHibernate xml file ({"Could not determine type for: System.Drawing.Image, System.Drawing, for columns: NHibernate.Mapping.Column(Settings)"}). How to map System.Drawing.Image to nHibernate ? And what MS-SQL dbtype is to be used? using System; using System.Collections.Generic; us...

How to select specific button by value? instead of ID - Windows Form Application

I'm trying to make an Aduto-Forum poster with VB.NET windows form application This is the page, http://www.inviteshare.com/community/viewforum.php?id=9 First I'm trying to log-in automatically I insert username & pass but I can't click the Login button because there are 2 buttons with the same ID on the page. ( input type="image" name="...

Need to make my database field a DateTime field currently is set to string

Here's my query Dim query as String = "Select * from openquery (devbook, 'SELECT wb.arrival_time FROM web_bookings wb ')" All I need is to convert my arrival_time into a datetime field in the query Is this possible? Thanks Jamie ...

Updating GUI before redirect

I have a GUI that contains several components (combo boxes, textboxes, etc) with their associated labels. When a button is pressed, the selection in each input component is validated, and if found to contain an invalid value, the label color changes to red and an error message appears. This works fine on its own. The problem arises when...