vb.net

Bitwise operations in Visual Basic .NET

Hello guys, I'm re-writing some old application in VB.NET to C# and ASP.NET 3.5. Everything is going OK but I have this problem - and, as the database will not be changed, I must find a solution to it. The old app saves the list o desired days (from Sunday to Saturday) in a byte. This is the way it do it: If chkDaily.Checked Then ...

How to change an image in a VB.NET Windows Forms app. System.Drawing.Bitmap in a PictureBox

I have a VB.NET Windows Forms app with a logo image on the form as a System.Drawing.Bitmap inside a PictureBox. I used the Visual Studio Designer to add the logo .bmp image so I don't currently have any VB code doing anything with it. I'd like to make the current logo a clickable object/button so when I click on it a file browser dialog...

Add new row to gridview

I'm using a gridview to display and access a sql database and using databinding. I'm also using autogenerate columns as one gridview has multiple sources and toggles between them. What would be the best way to allow the user to insert a new row? Would a listview be better? ...

How do I convert a two-dim array to a one-dim?

the problem is that I first have to convert the two-dim to a one-dim, then find the selected index and then convert again and then save the new index. after that I have to use the right string.format to show the right output.. I'm just confused =( In the program there are two text boxes that ask for "row" and "col" size and then you pr...

VB.NET: should all classes implement the IDisposable interface?

(very newbie questions) i may be misunderstanding this but on MSDN i believe it says that it is good practice to implement the Dispose destructor in every class you write. should i (do you) really implement the IDisposable interface with every class i write? also, is the proper syntax for implementing an interface to put the "Implement...

Distribute COM DLL made with VB.NET

Hello, I am experiencing a problem when I want to use a DLL made with VS.Net in VB.NET. I have a COM Class that create a DLL and a TLB file. I can reference the TLB in VBA and use the DLL in VBA on my computer, where I develop. The problem is that it is not working on other computer..? I tried to register the DLL with regasm.exe (althoug...

vb.net Recording video from media player component

Hi, I'd like to ask if it's possible to record videos from media player component in vb.net or not .. If it's possible could you explain how do I make it. Thanks in advance.. ...

Mix and Match Discount Code Advice

I need advice on how to implement. I have two objects ReceiptLine and Discount. Cashier scans item and a receiptline object is added. If the added ReceiptLine object have a Discount Id then, it has to lookup in Discount object and issues discount after validation. I have problem in validation. Here is the situation, cashier scans the ite...

How can I get a hashtable key name from a value in VB.NET?

I have a hashtable in VB.NET and I need to get the string value of a key from it's value. For example, if I do: hashtable.add("string1","string2") How would I get the value "string1" if I had "string2"? ...

Embedded VLC in VB.NET application for video Streaming

Right now I'm developing an application in VB.NET that streams video using VLC, but each time I want to stream a video I have to open a new vlc interface using a .BAT file and passing some arguments. The problem is that I need the VLC to be Embedded and stream from inside my applications. I have manage to get the vlc embedded and I can p...

Problem regarding DLL installation in GAC

I have installed a DLL in GAC it is isnstalled properly but it is not refelcted in reference. is there any problem? ...

In which namespace is the DelegateCommand in?

I am trying to work out an example from ".NET Domain Driven Design with C#", which contains a code example where you can see declared some attributes of type DelegateCommand. Now, I've tried googling it up, but I can't find its reference anywhere on MSDN (actually, I found this article, but not DelegateCommand's article itself). Is the...

VB.Net cast of 2 custom types

Hi! Sorry if this question is very very basic. I need to cast, in the better way, 2 objects of 2 types of 2 custom-classes (in VB.Net): The code: Public Class pluto Public Sub New(ByVal campoPippoPass As String) _campoPippo = campoPippoPass End Sub Private _campoPippo As String = "" Public Property campoPippo...

Visual Basic 2008 auto-scan controls

I have a form containes some controls (buttons) how i can make the program autoscan these controls one by one and whenever a button higlited I can bress enter to press this button. Using Visual Basic 2008 ...

RegEx To Match "whole word" returns exception

I am trying to validate via RegEx as follows... If Regex.IsMatch(Output, "\b" & "Serial)" & "\b") Then 'do something end if but i get this Argument exception parsing "\bSerial)\b" - Too many )'s. I do understand the error, but how should i modify the RegEx expression? UPDATE. The word "Serial)" is generated dynamically. That means...

Overloaded VB.NET extension method in class library

It seems that my library of extension methods that was written in VB.NET has problems. I have 2 overloaded extension methods Crop(). When i reference the lib from a VB.NET project i see them. If reference it from a C# project i can't see them. What the hell is going on? ...

Make Webcontrols.Calendar's SelectionChanged Event Fire when clicked on currently SelectedDate

Hi I have come with following solution but I'm not sure if it's the best one. What I specially dislike is the way I have to apply the style in the DayRender event, any comments? To overcome that problem what I did was to store the selected date in the viewstate and then reset the selected date. To preserve the marker on the selected da...

How to retreive Active Directory environment and session information with VB.Net

I'd like to be able to get and set the different information for a user in Active Directory on Windows Server 2003 under Environment and Session tabs through a VB.Net application. I am familiar with System.DirectoryService but I can not find the correct attributes for these particular tabs. For example, I'd like to check "Connect Printer...

MVC.NET in VB - Select List to Html.Dropdownlist

Seems most of the examples I find are c#, so in some cases I'm left scratching my head... to make a long story short, I'm simply trying to output the selectList of items to a drop-down within my view: My ViewModel: Imports System.Web Imports Whitebox.UI Namespace ViewModels Public Class TFS_VModel Public Property AccType() As IEn...

Can we use TypeIdentifierAttribute in .NET without COM?

I am curious if it is possible to make 2 interfaces in .NET (either in the same assembly or in separate assemblies) that can be treated as equivalent, using the new TypeIdentifierAttribute attribute. I have not found a way. I've seen some stuff on the internet that suggest this eventually would be possible, but it kinda looks like the ...