I've made an application in Visual Basics, But I Want A msgbox to appear when the form is closed would this work?
Private Sub Form1_OnExit(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.OnExit
MsgBox("Have You Saved, If Not Your Work WILL Be Discarded!", MsgBoxStyle.Critical, "Have You Saved?")
End Sub
I need to preserve a collection even after application exits. In ASP if i use application object this can be acheived. But in windows application what could i do to preserve collections?
I have developed a vb.net application which gets a folder as input with n number of .txt.When there are say 5 .txt files the application executes and produces the excel output.When there a n numpber of .txt files say 30, the application takes a long time and exits without producing the output.
Windows Forms VB Application.. I added a splashScreen to my application. And it was flashing only for a second then going away so I added a sleep timer to my Form Load event... The problem is now the splashScreen stays open even After Application exits, instead of simply closing at the end of the sleeptimer.. The Part of the Form Load event that is causing this is as follows:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load Threading.Thread.Sleep(5000)
I am running VS 2010 Professional and have a solution with 3 VB projects in it. I can open the forms in 2 of the projects just fine but if I try to open any of the forms in the 3rd project I get a message saying "There is no editor available for .....Form1.vb. Make sure the application for file type (.vb) is installed". Everything was working fine last month and I could open any of the forms.
Again the problem is limited to just the 1 project in the solution.
When i click on my installed VB.net application icon on the desktop,i receive the message : 'Application failed ti initialize property ox700000000000000 ..... click ok to terminate application'.
I have recently created an application where a lot of data is loaded into objects when the application starts up, and other data as it is required. For example if the user requests the catalogue page then it will load all the top level category data into objects of type Category. This will then stay there to be used by other users (who will therefore not have to load this data into objects) and can be altered by admin if they happen to login during the same application instance. I know this is not the most efficient solution, as pointed out below, but it works and the page load, at the moment, is not too long. It is very quick if most of the required data is already loaded into objects. It is also tailored to the business' needs - unlike other techniques such as Linq-to-SQL.
I want to allow my user to add urls to a database, much as a user might add file names. I have a form with a label, a textbox, and a browse button. I would like the browse button to load the user's default browser and then have the final url appear in the textbox when the browser closes. I have not been able to do that, but I have come close. I have not found a way to capture the url from an arbitray browser, so I instead load ie.exe and then capture the url with an OnQuit handler. That works (even verified by the debugger) but I am unable to get the url to appear in the textbox without actually clicking in the textbox once ie closes. I would like a suggestion as to how to avoid making my user click in the textbox and, if possible, to load the user's default browser and still capture the url. Here is my code for the Browse button (IE is defined at the class level as Dim WithEvents IE As SHDocVw.InternetExplorer):
I am trying to make a logout message box where it says "Are you sure you want to logout" and the options are yes or No. If user clicks Yes it should logout and its hould show login screen and if user clicks No. It should show the same form or the option remains un changed. below is my code. The problem is even if i click No. it logs out and takes me to login screen.
Dim result As String MsgBox("Are You Sure You Want To Logout", MsgBoxStyle.YesNo, MsgBoxResult.Yes) result = MsgBoxResult.Yes
I have a visual basic application with a media player built in that requires two .dll files.I wish to have an error message appear when the media player tries to start withought the files instead of a weird crazy confusing one that starts bu defult. is there any code like "if WMV.dll = not in directory than msgbox.show "You are missing the required files" I wish to show this to make it easier to identify by my users.
Is there a way to make custom message boxes and input boxes that are the same way as regular messageboxes? So if I named my custom msgbox CustMsg I could put the code like this.
CustMsg("This is a custom message box",I don't know what to put here,,"Message")
I have GridView in Application where I have my CPUserID. There can be thousands records in GridView with different CPUserIDs.
Now I have a button "Allocate Token". But before allocating the token I want to check in my Token Table that if that CPUserID has already exists in table it should not allow user to allocate token and will return some message for that user.
For Each curRow As GridViewRow In GridView1.Rows Dim cpuserid As Label = CType(curRow.Cells(1).FindControl("lblCPUserID"), Label) Next
I have been using the 'findby' method for sometime, but now it suddenly is failing me on a new data source I have added to the project. I have the data source bound to a form and I am trying to find values based upon a primary key. This evades me, I am able to look up rows using 'findby' with other tables, but not this one.
Dim AnsiX12Row As ansisupplementDataSet.ANSIX12Row = Me.AnsisupplementDataSet.ANSIX12.FindBySegmentElement(CurColName) If AnsiX12Row IsNot Nothing Then
[Code].....
I have checked and re-checked, the CurColName is for a value in the table, but cant seem to find it... I always have AnsiX12Row = nothingBradford W Brown
I have just converting my VB6 project to VB.NET 2008. I have set up start with Model. It start with Main() sub, in Main sub I have declare as below:
Dim frm as new Formpwd frm.show()
In formpwd I have UserId, PWD as test box and Two command buttons. The system executes form_load code and then PWD and UserId_Gotfoucus handler and then closes the system. Why is not waiting to accept UserId and PWD?
I created a game in visual basic. When the user answers correctly, a message box will appear and ask if they would like to play again. How would I get the program to exit when they push "No" . . .
Public Class Form1 Dim temp As String Private Sub RadioButton7_CheckedChanged(ByVal sender As System.Object, ByVal e As
Im working on a silverlight application where a user can create, edit, delete objects. The changes they make are placed in a queue which is processed every 4 minutes. When it is processed, the updates are sent over an async web method call to be saved in a sql database, one at a time. When the first update finishes, the next starts.Im having a problem when a user makes a change and then exits the browser app before the 4 minute timer has expired.Currently the changes are getting lost.Ive built on what the guy working on this before me has done, and explored the Dispose and Finalize methods, trying to start the update process when the factory is being shut down, but that isnt working due to the async nature of the web service calls. I get errors saying needed objects have already been disposed of.
I had originally saved the project I was working on to my desktop, but now I have moved the folder to another location on my hard drive (didn't want it on my desktop anymore).
But since I've moved it I get the message:
The working directory does not exist: 'C:old folder locationResources'.
Is there a simple way to update my project to the new folder location?
I'm running a bunch of automated tasks in a thread I'm creating via the Thread class. So I'm not using a BackgroundWorker.
During parts of the automation, the thread may exit. This is normal. But when the thread completes, I need to finish up some additional tasks. I can anticipate all of the conditions in which the thread closes, but I'd rather not to do the final tasks at each point, as this will create a lot of redundant code.
So instead, I wanted to write an event that is triggered when the thread exits. I looked through the Thread class, but all I could find was the ThreadState property, which has a Stopped property. But, when I try to add a handler to that property, it doesn't allow me.
For some reason, the next code found on MSDN crashes or exits after 30 cycles or, in other words, after processing 30th Property, exits without explanation. As I said, I found it in MSDN
With the code i have written can someone tell me how to make each user of the chat room have a different color message(text color) and were to place the code to do that.[code]
I am trying making a form to apear in the corner when a timer goes off. I have a loading function that loads all the times into arrays and sends it to a thread that runs a loop till todays date = date time. The problem I am having is I cant get the popup form to initialize properly. It either doesn't load the labels or background and the window is instantly unresponsive or it just blinks onto the screen and off before it does anything.
i want to make a message box appear when the user presses Alt k (then) Alt e (then) alt j . is this the correct code to use?:
Private Sub form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txt3.KeyDown Dim intcount As Integer = 0 If e.Alt And e.KeyCode.ToString = "k" Then intcount = intcount + 1
I was about to make an error message when there is no record both pat_brgyno and pat_famno in the database. I don't know how to make it. What my logic says is something like this:
mtb=maskedtextbox if mtbbrgyno.text<>pat_brgy and mtbfamno.text<>pat_famno then msgbox("No Record"
I was wondering if it was possible to make custom message box options. What I mean is, I'm going to have a button that pops up a message box. The message box will say, for example, "What is 10 x 10?" and I want there to be three options, instead of a Yes/No type of thing: "1000", "100", and "20". Is there a way of doing that? Or would I have to create my own message box using some software?