vb.net

Getting flash game to run in VB.

Just trying to use a VB form app to run a flash game from the .swf file. Keeps coming up with weird errors using both the web browser tool and microsoft web browser tool. Thanks. Edit: Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.frmFlasher.("http://website.c...

Custom Membership Provider not returning user

Hi, I have a custom membership provider I made up to use because our database is completely different than the ASP one. It does not have any fields such as PasswordQuestion, IsAnonymous, LastActivityDate...I mean our DB uses none of those and stores roles in the same Table as Users so I'm not sure if using the provider makes any sense. ...

Unable to view the COM Class Attributes in VS 2010

I am adding a COMVisible(True) class to my project. In Visual Studio 2008, I am able to have the COM class active in the IDE editor and when I look at the properties tab it gives me the ' Attributes' option in the drop down box. However, when I do the same thing in Visual Studio 2010 the drop down box is empty. I have also tried right...

Parallel.ForEach local storage

I recently changed a For Each loop to a Parallel.ForEach loop. I'm concerned about an object being declared outside the loop but assigned while iterating in the loop. Here is the simplified code. Dim results As ModelResults Dim noResultsModel As New List(Of ModelResults) Dim lock As New Object Parallel.ForEach(_modelEngines, Sub(mod...

.NET TreeView doing Postback instead of Expand when called through AJAX and rendered using RenderControl

I have a page which is using a TreeView. The TreeView is placed within a user control for ease of code reuse. If the user control is loaded directly on to the page, by using a Register for the user control and then placing it on the page, then it works fine - the nodes are expandable. In order to avoid having extra code on the page load...

Operator '=' is not defined for types 'Integer' and 'IQueryable(Of Integer)'

This is giving me a headache. I have this link query here that grabs an ID Dim mclassID = From x In db.SchoolClasses Where x.VisitDateID = _visitdateID Select x.ClassID And then later on I have this linq query ViewData("Staff") = From t In db.Staffs Where t.ClassID = mclassID Select t Any help would be much appreciated. I've tried ...

iTextSharp - How to input image (PNG) from project resource?

I have iTextSharp creating a pdf for me in VB.net. Everything was working famously, except now I want to embed an image. I tried this: Dim test = My.Resources.MyImage Dim logo = Image.GetInstance(test) This an error though: 'GetInstance' cannot be called with these arguments It appears as though it expects a path, and is getting...

Select a row once checkbox is checked in a listview (.net)

I've got a listview with checkboxes enabled. I've noticed that even with a row selected, you can still check off other checkboxes on other non selected rows. The selected row does not change. I am wondering if there is a way to automatically change the selected row to the row which has just been checked. ...

Environment.NewLine in .NET does not have correct value

Environnent.NewLine seems to be resolving to two spaces " " (as are vbCrLf and ControlChars.CrLF). Using StringBuilder, AppendLine is doing the same. I've been racking my brain and searching the Internet trying to figure out why this the way it is, but am coming up empty. I am trying to generate .bat file based on user interface deci...

How can i calculate time duration between sunrise and sunset?

Hello friends My question is How can i calculate time duration between sunrise and sunset? Then how can i divide this duration(sunrise to sunset) into 8 equal parts(Hr: Min)? All i need is starting and ending time of every part. And i want to write this code in VB.NET because in VB.NET i can easily design the GUI. Thanks ...

Why all the event checks in the ButtonBase WndProc method, .Net WinForms

I'm creating a base class for a button that inherits from Control as opposed to ButtonBase. I'm using reflector to look at ButtonBase to make sure I don't overlook anything important and I'm puzzled with the contents of the WndProc method. There's checks in there for things like button up, click and capture changed, which as far as I can...

accessing a subarray in vb.net (or the equivalent)

I read a an array of bytes from a file I pass this to a class that then assigns various bytes from that array to various members of varying sizes. Ideally i would like to do something like this memberThatIsAUShort = bitconverter.ToUShort(tempArray.subArray(3,5)) memberThatIsAShort = bitconverter.ToShort(tempArray.subArray(6,8)) Inste...

WPF Bind a ListView to Oracle Data Source

Here's a part of XAML of the application I'm working on: <ListView Name="lsvCustomerDetails" ItemsSource="{Binding myDataTable}"> <ListView.View> <GridView> <GridViewColumn Header="Script Name" DisplayMemberBinding="{Binding ID}"/> <GridViewColumn Header="Status" DisplayMemberBinding="{Binding status}"/> ...

Loop takes forever with large count

This loop takes forever to run as the amount of items in the loop approach anything close to and over 1,000, close to like 10 minutes. This needs to run fast for amounts all the way up to like 30-40 thousand. 'Add all Loan Record Lines Dim loans As List(Of String) = lar.CreateLoanLines() Dim last As Integer = loans.Count - 1 For i = 0 T...

width of the dropdown arrow

So in winforms, every dropdown combobox has this little arrow thingy to the right that tells the user it's a dropdown, kinda like this: Now how do I figure out how wide that is in pixels? Reason is, I'm using ControlDrawToBitmap, this doesn't draw the text properly for the combo boxes, and I can redraw the contents, I just whack some ...

Im trying to make a Repeater table visible = false.

I have a document management system which creates a report showing people who own which document. There are times where people have 0 documents and in that case I would like the repeater table for that person to not be visible. I have looked around for a while and have not had much luck, maybe its because I am new or maybe its because ...

Visual Basic and Resolution/Zoom?

Is it possible to change the resolution of the form without changing the resolution of the computer? And if not, then I suppose I'll ask, how would I be able to zoom/blow up the form to make it bigger? Thank you. ...

Fix Special Characters in String

I've got a program that in a nutshell reads values from a SQL database and writes them to a tab-delimited text file. The issue is that some of the values in the database have special characters (TM, dash, ellipsis, etc.) When written to the text file, the formatting is lost and they come across as junk "™ or – etc" When the value ...

How can you debug across projects in VB.Net if one launches the other?

I have a VS 2008 Solution in VB.Net that has 2 projects - a Launcher and the App. The Launcher is what runs first, checks to make sure the App has all the latest files from the network, etc. and then launches the App. The Launcher allows the user to select their environment (Test, Production) then passes those values into the App.exe a...

How to best flatten a tab-delimited table?

Here's an example data table (the data are fake, but in the same format as my business data coming from an external system): R1 Pears,Apples,Bananas 10 Oranges 5 R2 Apricots 15 Bananas 222 Apples,Oranges 15 The data are in a string. Columns are tab-delimited, lines are CRLF-delimited....