vb.net

Settings variable returning a different value in VB.net!

This is a quite strange problem. I have set a setting variable in Application settings with following data: Name: county Type: integer Scope: user Value: 0 Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county) It alerts 1. Despite being the first to be executed as soon as form loads. ...

Capture all keyboard events using VB.Net

Hi All, I've written an app with a simple textbox which attempts to identify a user from their typing habits (interval between key presses, duration key is held, time between key strokes ie a->s is quicker than a->v for some users, shorter for others depending on typing style). It's far from perfect but it does correctly identify modera...

VB.net faster than C++?

Possible Duplicate: Why does C# execute Math.Sqrt() more slowly than VB.NET? I'm running into an interesting problem, wherein I have code in VB.net and the exact same code in C++. I'd expect C++ to naturally run a tad faster than VB.net, but instead I'm getting the exact opposite: VB.net runs more than twice as fast as C++. Th...

another question about line break in UILabel

Hi everyone, I'm struggling with line break in UILabel. I'm generating xml in vb.net and then parse it in iPhone application. xml contains text which initially contains html tags such as , so I can and need to replace these tags with something to add a linebreak in iphone How can I do it? I tried \n , \n\r, they a not working Any help ...

C# Dictionary has no Value type option?

I am coverting portions of a code project article (http://www.codeproject.com/KB/linq/auto-logging-data-context.aspx) to VB.Net for my own uses but I've run across a piece of C# code written in a way that I've never seen before and which I don't know how to convert: private static Dictionary<type,> _cachedIL = new Dictionary<type,>(); ...

Derived Associations in .Net Entity Framework

I want to have a single table that represents a person and have a number of other tables (such as Student/Teacher) use the Person table to store information related to a person. Unfortunately the entity framework doesn't seem to like it when I try to add an association between the Student or Teacher class and I don't understand why. Th...

How to make my software run from pendrive?

Hello guys, I need to know how to make a software in Visual Studio(VC++ or VB) that can be run from a USB pendrive? Is there anyway i can create this standalone software that doesnt need any installation in the PC in which the USB is plugged into? ...

Is it possible to pass in a property name as a string and assign a value to it?

I'm setting up a simple helper class to hold some data from a file I'm parsing. The names of the properties match the names of values that I expect to find in the file. I'd like to add a method called AddPropertyValue to my class so that I can assign a value to a property without explicitly calling it by name. The method would look li...

Is there any limit on number of classes that a namespace can have in .net ?

Is there any limit on number of classes that a namespace can have in .net ? Further what is the recommended number of classes that there should be in a namespace? ...

DisposedObjectException in VB

I am using the DockPanel Suite from SourceForge and whenever I open a document and close it, but open it again, I get a an error saying "Cannot access a disposed object". What can I do to stop this from happening? ...

What format is needed to add multiple column groupbox's to a page?

I am using a grid layout and adding groupbox's, but can only add a single column wide. What do I need to use that will allow me to add multiple groupbox's to a single line on the page? ...

vb.net force method to handle thrown exception

I want to force a calling method to implement exception handling. Java forces a calling method to implement exception handling where it calls another method that thorws an exception. Does VB.Net have the same mechanism? ...

Build up formatted text programmatically to display in a RichTextBox?

What I'd like to do is build up a string with specific formatting to be displayed in a RichTextBox control. Something like this (this doesn't completely work): Dim testText as String = "" testText = "Test text" & vbTab & "with a tab." & vbCrLf testText = testText & "<b>This just prints out verbatim. How do I make it print bold?</b>" ...

Linq to SQL: Group By and Sum()

I'm very new to linq so this should be pretty easy to answer, but I've had a hard time finding the answer. I have the following LINQ statement, which performs a simple linq query and assigns the resulting values labels on an asp.net web form: Dim db As New MeetingManagerDataContext Dim q = From s In db.vwRoomAvailabilities ...

Class Hierarchy - Data design in an RPG Game (VB.Net)

I'm having troubles wrapping my head around how to organize the classes within my RPG project that I'm making. I've tried to implement a battle system but I am not comfortable with my initial results. This is the basic layout I currently have for my classes. clsCharacter > clsTeam > clsBattle clsCharacter contains statistics pertai...

Should I learn VB or C#?

Possible Duplicate: Should I learn VB.NET or C#? Question I have 30+ years of C experience, 15 of C++, no Java and rusty, 25 year old Basic (a bunch of other, probably not relevant, languages: PHP, Pascal, Ada, various assembers, etc). I will be using Visual Studio Express to create both Windows applications and brower based...

Cant get rid of "Configuration system failed to initialize" exception in Vb.net

Due to some bug I had deleted the whole bin folder *with* config files, yesterday but after doing so it was working fine but today the program always throws this exception: Configuration system failed to initialize. Even when I have recreated the configuration files. The exception is thrown as soon as application starts. ...

Controlling Image Resolution when coverting a PNG image into a PDF using iTextSharp

Hi All, I have created a PNG image that is 200 DPI, and perfectly sized for a landscape A4 page size. I needed to convert this to a PDF document, so I've used the iTextSharp library with the code below. This all works, however the image quality has degraded. Any suggestions as to how I might improve this? Public Sub ConvertPNGtoPDF(...

Help with events

I have multiple textboxes which I want them to perform the same thing upon clicking them. By default I can use the handles textbox1.click for 1 single textbox as shown below but I am not sure how to do handle multiples of them. Of course I can write a handler for every single textbox but I have about 50 of them. I am sure there must be a...

How to code a Button's Click Event?

I'm using winform and fb.net. Can someone provide me with an example of how to create a buttons click event? I have dim but as windows.forms.button but.name but.text but.location etc. but I how do I create the Click and the code behind it? ...