vb.net

RIA Services + Entities - Date moving 24 hours earlier in client

Hi All I am currently working on a silverlight project with RIA Services and have seem to come across a bug(or wrote a new one). In a simple query I am retrieving a entity model from the server. In the server side service class a DateTime is correct(to what's in the db) but on the client it seems to go back 24 hours and maybe 10 hours....

When should I use public/private/static methods?

Hello, I'm new to C#.Till this moment I used to make every global variable - public static.All my methods are public static so I can access them from other classes. I read on SO that the less public static methods I have,the better.So I rewrote my applications by putting all the code in one class - the form class.Now all my methods are...

How Do You Get the Handle of a Control in VB.Net 3.0?

I need to get the handle of a control as an IntPtr to pass to a screen capture class in vb.Net 3.0. Tried this but get an invalid handle exception. Dim hwnd As IntPtr = Runtime.InteropServices.GCHandle.Alloc(CanvasMap) Any help would be greatly appreciated. Thanks ...

Dynamically identify/locate HTML tables within a page?

Admin users can add HTML content to a website via a CMS textbox control. When this content is displayed to a website visitor, I'd like to identify the presence of a HTML table (added by a Admin user using the CMS) and display an option for visitors to export that table. I can handle the exporting, but identifying the HTML tables has me...

Select Case True

Apparently this used to be a way in VB6 and VBA to short circuit and execute the first true case: Select Case True End Select Is this still in use (VB.NET) ? ...

Deep copy System.Windows.Forms.WebBrowser Object/Restore State

Essentially what I want to do is copy a WebBrowser object such that I can do the equivalent of "Open In New Tab" or "Open In New Window" actions, maintaining any posted data. I don't just want to navigate to the same URL as in the original WebBrowser object, rather I want to repeat the HttpWebRequest. Is this possible? How? ...

Migrating Handles from VB.NET to C#

Hi, I'm migrating some code from VB.NET to C# (3.5). I find structurs like: Public Event DataLoaded(ByVal sender As Object, ByVal e As EventArgs) Protected Sub Mag_Button_Load_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Mag_Button_Load.Click [..] RaiseEvent DataLoaded(Me, EventArgs.Empty) End Sub [..] 'Other C...

How can I use a page_load local variable in event handler of a button

Hi, Im making a site in Visual Studio using vb and I have a variable in page_load but need its value in the event handler of a button for passing on session. Any suggestions on how I can do this? Any help is appreciated ...

How to copy and paste a file with the clipboard from a compressed folder using VB.Net

The question says it all. I want to paste a file from the clipboard that has been copied from a compress folder using VB.net. By examining the clipboard, I see there is a FileGroupDescriptorW which seems to contain some information about the file. But I have not found how to use the information to grab the file and paste it. ...

Question inheriting from List(of T) class

I want to implement a priority queue class. When an item is added at a higher priority it is pushed to the front of the queue instead adding to the end of queue. Simple few lines of code Public Class PriorityQueue(Of T) Inherits List(Of T) Private _list As New List(Of T) Public Sub Enque(ByVal item As T, Optional ByVal pu...

Will VB.NET automatically generate ComClass attribute and guids?

I've run across some VB.NET code that explicitly creates three GUID constants and uses them in a class's ComClass attribute. I've written COM-aware classes in the past just by checking the "Make COM-Visible" and "Register for COM interop" options in the project options. Is this explicit code simply unnecessary, or is it doing something a...

VSTO: Application Focus

Anyone know of a way to see if the Excel window of a VSTO project is active/in focus? I'm looking for an equivalent of System.Windows.Window.IsActive. ...

vCalendar for OutLook

I am new to this, I am trying to save a reminder to outlook. But it is not doing anything. Wondering what is wrong in my code. Here is my code DownloadAsVCS(BuildVCSFile(sVcalType, sVcalDate)) Public Function BuildVCSFile(ByVal sVcalType As String, ByVal sVcalDate As String) As String Dim beginDate As Date = #1/7/2005 4:00...

Excel VBA to VB (DCOM)

I inherited an Excel VBA spreadsheet. I have been tasked to convert it to VB. The application acquires data from a PLC using a DCOM object (I think). The following code runs the sub SBR1Select when MX1.0 is updated. Sub Workbook_Open() ActiveWorkbook.SetLinkOnData "dassidirect|strandburner!MX1.0", "SBR1Select" End Sub When I op...

How to get keyboard presskey values in a VB.NET 2005 application?

Hai How to get keyboard presskey values out of the application in vb.net 2005. I try form keydown event that is working in Application Active. ...

ASP.NET Locks up only in a single browser

I have a complex application running on IIS7 and Vista. It usually works ok but sometimes during longer processing threads/pages it seems to block(appear like there is no more wp's), but it blocks only on a single browser. Eg I have firefox open and go to a page which sleeps for 10 mins, then I hit other normal pages and these pages al...

Delete from multiple tables ASP.NET

How to delete from two tables at once using the same delete statement in ASP.Net? ...

How do I create a strongly typed view page using ASP.NET MVC VB.NET XML Literals View Engine?

I am using the ASP.NET MVC VB.NET XML Literals View Engine created by Dmitry Robsman and described on his blog in this post. http://blogs.msdn.com/dmitryr/archive/2008/12/29/asp-net-mvc-view-engine-using-vb-net-xml-literals.aspx I would like to create strongly typed view pages using this view engine, but it doesn't seem to contain the ...

Accessing Windows Media Player's Playback Speed controls

Is there a way to access WMP10+'s playback speed controls in a dotnet app? User level information on the Playback control information ...

List View displaying Pictures

I am using a ListView control to display Pictures along with description and caption. I used to save the full path of the image in the url field, so when I display them in the ListView I don't need to edit anything. Now I am using something like: HttpContext.Current.Server.MapPath("~/photos/") + savedURL How can I edit my ListView t...