vb.net

Problem with HTML? Scrollbars Not Appearing via window.open

I have a VB.NET web application where I am opening a window when a user clicks on a link to view some external tabular data. The data I'm displaying definitely requires a vertical scrollbar in order to see everything...For some reason I cannot get a vertical scrollbar to show up when the new window loads. Here's the JS that opens the wi...

How to detect mouse wheel tilt?

To detect rotation of the mouse wheel in .NET/WinForms, I can override OnMouseWheel. Clicking can be detected by overriding OnMouseDown (it's just the Middle button). But how do I detect tilting of the wheel (tilt to the left/right for horizontal scrolling)? Neither OnMouseWheel, not OnMouseDown is being called when I tilt the mouse whee...

calling a method over variable of type object in vb and c#

in vb I can do that sub SetFocusControl(byref ctl as object) ctl.Focus end sub in c# the compiler complaint that object doesn't have a Focus method void SetFocusControl(ref object ctl) { ctl.Focus(); } how can I do the same in c#? thanks ...

Protected Constructors and MustInherit/ Abstract class

What is the difference between a class with protected constructors and a class marked as MustInherit? (I'm programming in VB.Net but it probably equally applies to c#). The reason I ask is because I have an abstract class that I want to convert the constructors to shared/static methods. (To add some constraints). I can't do this becaus...

Play Sound in .Net using generated Waveform data

How can I play a sound based on waveform data that my .Net program is generating from user input and mathematical functions? By "waveform data" I am mean SPL values in a fixed interval time-series (probably 44.1 kHz). I presume that this requires some kind of streaming buffer arrangement. Note, that this has to be live/real-time, so j...

Why use a public property instead of a function to expose a custom collection<T>

During a code review I looked at set of repository classes (in vb.net). I am used to seeing these repository classes full of functions that return collections (among other things) of your domain objects. However, this repository had 1 public property and 1 private variable that looked something like this: Private _item as Collection (of...

How to connect MS Access database from a network in vb.net 2005

I want to connect an access dabase from a central server using vb.net 2005.Can you help me? please. ...

Is it possible to pass a variable's name along with the value, when passing through functions?

I want to know if it's possible to retrieve the variables name from when it was passed into a certain function. For example, if I call parseId(myId) to a function with the signature parseId(id), i can obviously retrieve the value of 'id'. However, is there any way I can retrieve 'myId' as a string (without passing it as another value)?...

dragging picturebox inside winform on runtime

i need to be able to drag and drop my picturebox with an image in it around my winform in vb.net. ...

moving image on webpage

is this solution possible in asp.net http://stackoverflow.com/questions/1086989/dragging-picturebox-inside-winform-on-runtime i just want to be able to move an image around on a webform ...

triggering javascript events using asp.net

I'm writing an asp.net web app. and i've hit a bit of a brick wall. basically i have 2 pages, the main page with a text box in and a popup that contains a treeview. My problem is this. when i select a treeview item i want the program to perform some database transactions using asp.net and then pass the value retrieved from the database i...

In C# VS2008 how to replace (string)aaa to aaa.ToString()

I just converted a VB.net solution into C# solution. But lots of variables have been coverted like: string var1 = (string)1; string var2 = (string)intVar; //intVar is a int value I just want to convert all (string)XXXX to XXXX.ToString() by using some Regular expressions or some other replace methods. Can someome help me out? ...

How to setup return value for a readonly property using RhinoMocks in VB.NET?

I'm using RhinoMock in VB.NET and I need to set the return value for a readonly list. Here's what I want to do (but doesn't work): dim s = Rhino.Mocks.MockRepository.GenerateStub(of IUserDto)() s.Id = guid.NewGuid s.Name = "Stubbed name" s.Posts = new List(of IPost) It fails on the compile because Posts is a readonly property. Then ...

Vb.Net String Manipulation & or +

I just had a simple question, but I cannot seem to find a straightforward answer. I've been wondering this for a while, though. I have seen several programmers use & and + for string manipulation. Such as: dim firstvar as string dim secondvar as string dim thirdvar as string thirdvar = firstvar & secondvar Or is it: thirdvar = ...

Vb.Net CA1822

I ran a Code Analysis and got this message: Warning 5 CA1822 : Microsoft.Performance : The 'this' parameter (or 'Me' in Visual Basic) of 'MainForm.CheckFileIfFileIsInUse(String)' is never used. Mark the member as static (or Shared in Visual Basic) or use 'this'/'Me' in the method body or at least one property accessor...

ASP.Net: List of Object in httpcontext.current.cache

Is there a way to look through the cache for all objects in the cache? I'm dynamically creating objects and I need to periodically go through the list to purge out objects I'm no longer using. ...

Is it possible for Visual Studio 2008 Automatically create XML Comments tags without "Generate XML documentation file" checked (VB.NET only)?

When in VS 2008 if a developer hits the ''' it generates the XML comment tags for you, but this only works when the project setting for "Generate XML documentation file" is checked. Is there a way to tell VS to generate the XML Comment tags, regardless of the project setting? I think it is possible that someone may want comments but no...

Linq query has an implicit cast error for DataGridViewRow when option strict is enabled

I have a DataGridView that is bound to a list of objects called "BaseChange". The BaseChange objects are made up of 4 properties... ChangeType ChangeStatus ChangeDescription LastChangeDate The datagridview has columns for all 4 values as well as a 5th (a checkbox column called "colIsSelected"). There is no problem binding the list to...

In C# VS2008 how to replace intA = (int)obj.GetStr("xxx"); to intA = int.Parse(obj.GetStr("xxx"));

In C# VS2008 how to replace intA = (int)obj.GetStr("xxx"); to intA = int.Parse(obj.GetStr("xxx")); I have thounds of lines code have this pattern. I just want to pass compile by using some regular expression. ...

Change how variables look in debugger, vb.net 2003

I've been given an old VB.net 1.1, Visual Studio 2003, project. When debugging DateTime shows as #09:34:00 AM#, the date-part is hidden. I would like to see which date the DateTime is. I've tried to modify mcee_cs.dat, but that doesn't seem to do anything. Is there some other file I should modify to get my desired behavior? /L ...