vb.net

How do I display something else if Google Ads is blocked?

I have a website developed in ASP.NET and VB.NET which has a place for a 160 x 600 google ad on the right hand side of the page. It looks good when it shows on the page but I have discovered that when the google ad is blocked, like it is at my workplace, the page looks incomplete. There is no message that shows to say the ad is blocked...

Detecting Key Presses

I am writing a program that expands the usage of the clipboard, but I need to tell when the user has either cut, copied, or pasted something so I can write code accordingly to that. I need to know how I can check to see when the user has entered a command like this. ...

Refactoring: Gridview Export to CSV file

These routines (vb.net) allow you to dump a gridview to CSV, even if there are templated controls in the cells. It works, but I'm not thrilled with it. What improvements should I make and why? Private Shared Function CsvFormatted(ByVal t As String) As String If t.Contains(",") Then t = """" + t + """" End If Retu...

Silverlight databinding

Well i have this code in my code behind Public Shared ReadOnly UsernameProperty As DependencyProperty = DependencyProperty.Register("Username", GetType(String), GetType(LoginControl), Nothing) Public Property Username() As String Get Return CStr(MyBase.GetValue(UsernameProperty)) End Get Set(ByV...

MasterPage and ViewState (VB.Net)

Ok So i have written methods to override the LoadPageStateFromPersistenceMedium and SavePageStateToPersistenceMedium methods. now the problem is that i am using a masterpage, so how do i maintain using my masterpage and still inherit from System.Web.UI.Page? Please bear in mind that the .vb Code behind the masterpage already inherits Sy...

Subsonic 3 work virtual basic .net project

hi i download subsonic 3 today (subsonic 3 preview 2) but this don't work in vb project ! i think because .tt file (for generation) is C# template so this don't generate vb code ! can you help me ? thanks... ...

How to add VB.NET Class to GAC, and use it in Code-Behind

I created a VB.NET Class, and created a strong key, and added it to the GAC using the GacUtil. That part has gone smoothly. The Assembly is installed in the GAC and seems to be installed/configured correctly. FYI, the assembly is a Class called Tester, that exposes one public static method called HelloWorld, which returns a string, "H...

Make an object accessible to only one other object in the same assembly?

Each business object has a matching object that contains sql calls. I'd like to restrict these sql objects in a way where they can only be used by the matching business object. How can this be achieved? Update Greg brought up the point about testability. Since the SqlObjects will contain very business-process specific sql I don't want ...

Other (better) way as the index to indentify a gridview row cells?

Hi, i have to modify an asp.net application. The app consists of an huge gridview with lots of javascript, controls and cell modification (color cell etc.) in it. Now i have to modify the gridview to add some more colums. Lot of code is based on identifying a cell based on its index e.g. row.Cells(1). Is there way to optimize this beh...

Why can't I center an image on a page for printing in VB.NET?

My application draws charts in a Windows Metafile. Users need to be able to print the charts nicely centered on the page. Quick rundown of printing code: Private Sub PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Dim header As Imaging.MetafileHeader = metafile.GetMetafileHeader() Dim sz As New SizeF(100 * hea...

VB.NET: Resize an image (jpg,gif,png) to avoid out of memory error in Picturebox Control on .NETCF 2.0

I'm searching for a solution to resize image(jpg) being passed in from an array in Picturebox Control on .NETCF 2.0 in VB.NET without resorting to using the opennetcf library, is it possible? ...

Constructing Dynamic Properties at Runtime in VB .NET

Is there a way to dynamically create properties at runtime in VB .NET using introspection? e.g. Suppose I had a class Public Class Foo Public Property Bar() As String get ... end get set(ByVal value As String) ... end set End Class Is there a way to create property Bar at runtime? T...

How to make your program open on startup?

I want my users to be able to have my program open on startup. I am coding in vb.net. How can I go about doing this? I can't find a "system startup" folder anywhere that I could just copy a shortcut to. Thanks for the help! ...

Error trying to rebind DataSource to DataGridViewComboBoxCell?

I have a DataGridView with two DataGridViewComboBoxColumns. I want to use the selected item in the first column to trigger a re-population of the items in the second column, on a per-row basis. Here's the code I have so far. "addlInfoParentCat" identifies the first column, and currentRow.Cells.Item(1) is the DataGridViewComboBoxCell t...

Trouble getting an Enum to cooperate with me.

I have this problem with my code, I get an exception during compilation. Can anyone help me out? if (Page.IsPostBack != false) { System.Drawing.KnownColor enClr; System.Collections.Generic.List<System.Drawing.KnownColor> ColorList; ColorList.AddRange(Enum.GetValues(enClr.GetTyp...

LinqToSql - Prevent sub queries when limiting number of rows returned

Dim query = (From p in Parent _ select _ p.ID, _ Tags = String.Join("|", p.Child.Select(Function(c) c.Tag.TagName).ToArray)).Take(100) In the above query, when using Take to limit the rows returned, a separate SQL query is executed for each row to return the 'Tags' field. If I remove Take(100), a single query to sen...

how to add UAC manifest file to vb.net

Hi, How can I add and embed manifest file in VB.net, in order to add UAC support to my application. ...

picturebox image clearing

i created a drawing apllication in my solution by this code.by this i can draw images in a picturebox and can to save. when i click the clearbutton the image on the picturebox is cleared but the problem is after clearing the image i can't draw any thing in the picturebox without the form's reload dim mousepath as new system.drawing.dr...

Keyboard messages Windows flow problem and doubt

I'm developing a program where I've had to add a keyboard shortcuts system. The problem is it uses a third party OCX for a part of its display, and it is catching some essential WM_KEYDOWN messages when in focus, like Ctrl+C, Ctrl+V, etc. I've tried catching the WM_KEYDOWN message through WndProc, but the message is not propagating, so ...

Application is not shown. Why?

Hi, My application was built with VB.NET. It's an EXE application. It's already running well on dozens of Windows hosts as an independent app - without a development environment. Now I try to run it on a Windows 2008 server (as a native app), but the form is not shown - nothing is displayed. When I debug, I see that it's running all "f...