I've been trying to convert some old VB6 code to VB.Net and ran into a programming problem. Basically the Set keyword from vb6 is no longer used in VB.Net 2008 and 2010. So with that said, this won't work in .Net, (assuming you referenced the ActiveMovie control type library in vb6, which is basically DirectShow):
I have an desktop application that references several dlls. All are targeted for .Net 3.5, x86. The applicaiton has been deployed for several years and was upgraded from visual studion 2008 to 2010 last year. I have made several changes to the app since then (as recently as last Thursday) with out any issues. Now, everything builds, but when I run the application, I get a type initialiazer error when one of the projects is loaded by the main application.
The error messsage is {"Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.":"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}.
There were no changes to this project since the last successfuly deployment last week, but today I am getting this error.
i have a application that i designed for an assignment which uses a DB (ACCESS) However when i publish the application it fails to load even though the application completes. I have managed to find that it is the database that is not copying over, how do i solve this (the db is located when debugging and is also in the project files)
It happens quite frequently, more times per day, that with Visual Studio 2010, during the debugging, when I used Immediate commands like:I receive the following error:
'NamedVariable' is not declared. It may be inaccessible due to its protection level.
Now I see that VB tells me that label arrays are no longer supported But I also see that VB2010 is providing the relevant logic to update each of the label array fields I was until today using VB2008, because after running this application it crashes with a report of stack overflow, I assume it is related to the label arrays, but have no idea. So I have upgraded to VB2010.
In VB2010, I note that the immediate window is reporting A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll Now I have used label arrays for showing columns of like data, generated by a for loop. What should I be using it its place, maybe a grid..
I'm using Regex.Replace function. It fails to accept trackbar1.value as "replacement as string". This code returns "Reference to a non-shared member requires an object reference." error:
well until a few day ago. I don't know what I have introduced to cause the problem but now, whenever I load the project, VS 2010 (SP1) crahes. If I delete the project's suo file, the project loads (really quickly) and all is well until I exitVS 2010. When I re-run it and try to load the project, it crashes again unless I delete the suo file.The program can be built for x64 and x86. Now, when I reload the project (after deleting the suo file), it comes up in Debug - Any CPU mode. I can change from Debug to Release and from Any CPU to x86 but if I try and change from x86 to x64, VS 2010 crashes.This is not always the case though. If I build the x86 version and then switch to x64, all is well and I can build the x64 version. Obviously, there's something wonky going on.
I just discovered the joys of UserControl's and I was wondering if it is possible to populate the usercontrol with data from a database in the UserControl's Form.Load event instead of the form the userControl is placed on. I feel it would make using the control a lot easier if it just populated itself without anymore code.I tried it with a ListView but it gave me a bunch of errors, so I didn't know if it had to be done a certain way or if it was just one of those things that doesn't work no matter what.
Im making a program to list something from a xml file to show it in a listview, but im having some problems. The early versions of the code where able to read thru the xml file faster than the newer one... Does anyone know of any other method of reading a xml file? Here's my code :
PHP
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click op.Filter = "Xml|*.XML"
[Code].....
I've been looking around for a loop that does things uh.. A bit faster but i didn't find any.
I am creating a app to analyze databases for duplicate data for multiple projects. For example, I might have 10 different access databases to analyze individually and I would like to choose them from a dialog control if possible. After the connection is made I will then proceed to run the query from the button click event and spit out the resulting data into a separate winform.
I have a form in design view and when the form loads, I want the TimeMaskedTextBox to show the time now. But allow the user to change the time for later time in the day.
Let's say the time now is: 09:00 and the user wishes to change time to: 22:00 and when the form is saved, And a new form is loaded then the TimeMaskedTextBox will go back to the time now. How would the code be written.
I have a massive collection of resources saved inside my program, added using the VS editor and I want to be able to enumerate through them. Is there any way I can do that?
Try Dim username as String = My.Application.CommandLineArgs(0) Dim password as String = My.Application.CommandLineArgs(1) Catch Msgbox("Cannot launch") Application.Exit Exit Sub End Try
I placed this in the form's load event. What I want is for this check to run before the form even loads.If an error occurs, the msgbox comes up and the form is never seen. When I try the code now, the form comes up the msgbox shows. When the user clicks OK the form closes. I tried placing it in the form's designer but the designer tries loading the form any way. How do I get this check to run before the form shows?
OK, I've been searching for hours trying to find the best way to fill a listview from a comma delimited file but have come up empty handed so far. Currently I am using code I found on the NET, which works, but it is EXTREMELY slow. As a test, I created a file with 5,000 rows, and 10 columns. The column layout is as follows:123,NAME,NAME,NAME,NAME,0.00,NAME,YEAR,NAME,1
Dim ofd As New StreamReader(".dataCardData.bct") Try Using reader As New Microsoft.VisualBasic.FileIO.TextFieldParser(".dataCardData.bct") reader.TextFieldType = FileIO.FieldType.Delimited reader.SetDelimiters(",")
[Code]...
The code I am currently using appears to be loading the file and somewhat simultaneously filling the listview at the same time. I feel that I should load the entire file into an array or arraylist and the send the array or arraylist to the listview. However, if this is the best way to do it, I have not been able to find any examples of how to do this.
I am making the Transition to VB.Net (using VB.NET 2010 express) and I have a simple problem that is driving me crazy. I wish for my Form when it Loads, initialise and then call a sub and do some stuff eg perform a plot. If i place a button on the form and click it the sub works fine.This task was simple to do in VB6 but for the life of me I cannot get it to work in VB.NET. Has the Form-Load event changed in some way with .Net?
I have a calculation project with 6 forms. The last form shows all the input and output data from the previous forms. This is accomplished in form6 load event. Form6 contains about 40 controls (mostly textboxes, labels and few pictureboxes), populated in this way:Textbox1.Text = Form2.Textbox3.Text, etc.I am not sure if this is a good practice. I know I can use the DGV, but it does not suit me because of the graphical reasons.
im having a problem i have a startup form now when it load its check the date and check the date that comes from the database now i got i want after the first try now when i try to log out (after log out click the startup form show) and the code does not execute in the startup_load event i use me.hide to close my startup form after login.. is this the problem thats why after 2nd try it does not execute my startup_load event how can i resolve that i use me.dispose but it close all my program..
I have an app where there's an edit form and it loads a bunch of stuff into comboboxes which takes half a minute to load the first time. Once it's loaded I keep the instance of the form and just hide it instead of disposing it until the app exits. What I would like to do is in the Sub Main of the app (there is no startup form) I would like to launch a new thread and load that form into memory, but I don't want the form to be displayed at that time, what's the best way to do this?
I'm current using this to populate a listbox with some data:[code]I want to do the same but using a datagridview. It's possible to use the structure I already have to populate a datagridview? I searched but found nothing about that.
A menustrip button click allows you to browse for a text file which when you open will take the text in the notepad and put it in a dropdown combobox. The text in the notepad would have to be
I'm currently developing a compact program, but i need to use some .dll as references. Thats ok! But the problem is, i need the .dll reference together in the same directory as the program which i dont want to, since i need it to be compact, just on .exe.
Is there any way to load the .dll reference via the Resources or another way?
im writing program that records cursor moves and plays it. I want save and load that coordinates to .mco file but i don't know how. I have an idea but code will be 454679053 kilometers long and it takes 2 centuries to write.
I'm trying to load a datable into a datagridview, but column1 ("date") should be converted to a datetime, so I can sort it when I click on the datagridview header. I tried this, but it gives me that there is no column 0 or one. I have 2 columns: "ID" and "DateStart"
What I was thinking of is load a webbrowser window somewhere in the form, but within the webbrowser size, by default, load only say the Half left (or right) part of the webbrowser window. In pseudocode it would be smth like webbrowser1.show(1*webbrowserWindow.Height, 0.5*webbrowserWindow.Width, webbrowserWindow.With.StartFromLeft/Right). Now I know it sounds pretty crazy, but it would be smth very handful for me. Look at the SS below if you didn't get what I'm trying to say because that's quite possibly as clear as I can be.
I haven't used VB in decades and I'm restarting with what I thought would be a simple program. I have two fields on a little form, both of which display a date (dd/mm/yyyy). Field1 is an entry field except on load where is contains a date calculated from field2 (which is 'now' upon application load). Field1 is 'now' + 10 days. This is the default state.
Once loaded (with the data described above), the user can input only in field1. Field2, an inactive field used only for display, is field1 - 10 days. After 15 seconds, fields 1 and 2 revert to their default states as described in the first paragraph. I'm getting all messed up with the 'on load' state. I'll start playing with the timer once I get the initial stuff done.
All of the sudden, I'm no longer able to build a Solution without getting an error in VS 2010. A minute ago I was able to build, and now I can't.
The error is: Unable to load referenced library 'C:Program FilesReference AssembliesMicrosoftFramework.NETFrameworkv4.0System.DirectoryServices.dll': System Error &H8013110e&
I've checked and the .dll is there. I've re-booted and grabbed the latest version from Team Foundation Server.
I have set up a form that will act as my parent (this hasnt been set up as an MDI).On this form I have a Panel that I will be loading forms into. I have a form that contains a DGV. On the load of the parent form, I then load this "child" form into the Panel. In the onLoad event of the "child" I go off to the database and populate my DGV. Then I run through the rows in the DGV and add in a logo image in the first column and change some cell colors based on values in those cells.
This all works great, however, when the child form finishes loading all the changes are lost. eg The logo images go back to the red cross and the cell coloring is gone.If I call Me.Refresh() in the child window as the last line in its Form_load event I can see the logo and cell colors update to what I want, but as soon as it has updated, its like it immediately refreshes again and all the changes are gone.