Make Collections Last After Close?
Mar 10, 2012Is there a code to make the contents of a collection stay the way that they (everything is still stored) are instead of being erased when I close my program?
View 6 RepliesIs there a code to make the contents of a collection stay the way that they (everything is still stored) are instead of being erased when I close my program?
View 6 RepliesI'm having a problem with this code in the highlighted line(*); getting the error in the heading.
Dim htmlarraylist As New List(Of iTextSharp.text.IElement)
htmlarraylist = *HTMLWorker.ParseToList(New StreamReader(tempFile), New StyleSheet())*
[Code].....
[code]...
What's really the point in using the former?It's hard to use linq if I used the former. I have to convert that to an array first which is difficult because there is no (asarray) function.I think I would change all of my code that's using System.
Collections.Specialized.StringCollection to System.Collections.Generic.List(Of String)
I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.
View 2 Replieshow to Auto Close a Form after a given interval I tried this From the Calling Form (MainForm)
SmallForm.showDialog()
Is there away to make a kind of message box, there pup up in maybe 3 second, and then close down auto.
View 2 RepliesI have searched all the code here I can find. I have added a bunch of code that some said should fix the problem. but it persists.
Given the code below, I open a small .xml file and then try to save it as a .XLS file. Should work just fine. When I monitor Task manager, the instance of Excel shows up immediately. But despite all the code I have added, it still won't go away, even if I exit the application. And if I run the process twice, I get multiple copies of Excel in task manager.
If the instance of Excel in the task manager went away when I exited my app, I would assume that there was some reference that was instantiated (behind the scene maybe) that persists until then. But this is not the case.[code]...
How can I make my text box send the value that was entered when pressing the key "Enter"? I have tried the "textbox_enter" event and it wouldn't work. When I press enter it makes a noise (something like "ding" xD).
View 4 RepliesMake program which task manager can't close him.
When user click on end process like system process message box show and user cant close that.
I wrote a program using VB 2008 Express Edition and noticed that when I close the program (by clicking the "X" top right corner), sometimes the program is still showing in processes within Task Manager.What do I need to include in my programming to make sure this does not occur - i.e. make sure the process ends when I exit the program?
View 3 Repliesiam working to develop a CMMS software for my company this software will connect to MySQL over LAN or WAN and i will update and view data from MySQL many times in software (to insert, delete, update,...) now i code every time i use the data , i connect to mysql and make my order and close. as the following code
[Code]....
The problem: A dialog's FormClosing() event is raised if it's a child, ie it's Owner property is set to the parent form, but NOT if it's a child-of-a-child. So closing the main form does not call the closing event on any grandchildren dialogs.
The Details: A dialog prompts to "Save Changes?", with YesNoCancel buttons, in the FormClosing() event. Clicking Cancel keeps the dialog open, ie cancel closing.
Private Sub Dialog_FormClosing(...) Handles Me.FormClosing
If MessageBox.Show("Save Changes?", YesNoCancel) = No Then
e.Cancel = True
[Code].....
Then the FormClosing() event on the child does not raise, if the top-most parent is closed.
Is this a know design limitation in the framework? Is there anything I should consider before I start hacking a nasty solution for this?
i an making a password program and with two codes
1. how can a make the password changeable
2. how can i make the close button not work?
I caused the VB.NET2008 IDE to do something extremely odd and unintentional with some code I was writing. As some of you know, I mostly write programs for industrial equipment. On one of our products, I needed to make certain forms automatically close after a timeout period. To do this, I began programming a usercontrol with a Timer on it (interval = 1000) and a ProgressBar. Timer.Enabled was set to the Enabled event so I could toggle it. When the control counted to it's timeout period, it would call Me.ParentForm.Close
So I build my project, and drop it on a form in the IDE and I see it begins counting! Huh... I had no idea timers were active in the IDE. I wonder what happens when it hit's it's trigger? I figure probably nothing since Me.ParentForm was actually the designer. When it triggered, the whole IDE crashes without save. I tried it twice now. Here's my
[Code]...
How do I Close a Form and then open a new one straight away? Im trying to make a Login for a Program, but I want the Login Box to open first, then disappear when the credentials are correct and a new Form to load.
View 3 RepliesI have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?
View 2 RepliesIt seems like whenever i click my close button the application will close but the debugger is still in active.How to exit this debugger? :)
View 2 RepliesIn a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another
View 5 RepliesI have two Close() functions in same class as below:
[Code]...
sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function.
View 3 Replieshow to use windows calculator in vb.net 2008?
use System.Diagnostic.Process.Start(calc)
its working but i want when application close it also close this calculator how?
my web browser is my main form and it has a number of sub forms , how can i set it that when i close the main form my sub forms dont close ?
At the moment when i close the main form all the forms close
how can i close a hid form without make "end process " in the task manger.how to save a textbox.text inside text file if the form closed be "end process " in the task manger?
View 7 RepliesIf e.CommandLine.Count > 0 Then
Dim IncomingCommand As String = e.CommandLine.Item(0).ToString
If IncomingCommand.Substring(0, 2) = "-1" Then
form1.close()
End If
End If
I am trying to make the program close if the -1 string is sent with the program. See my installer allows for me to run certain programs before it actually installs, but it doesn't shut down copies of the program itself. So I have a next startup instance set to shut the program down if the -1 is received. But if the program is not running it starts up instead. This is not desired. form1.close doesn't work. e.cancel = true doesn't work, etc etc. What can I do to make the program not start during this instance.
I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.
Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click
Dim f As New frmOrder3
[Code].....
I want to make a Hidden Application,my application Block Unwanted software or Application
View 13 RepliesI would like to create a customer class and be able to add collections to it. I know I have to use List<T>. Look at the scenario below. I have a customer class, order class and address class. I would like to instantiate the customer class and add orders and addresses to it. E.g.
Dim oCustomer As New Customer("Acme Inc.")
oCustomer.Orders.Add(New Order(1))
oCustomer.Orders.Add(New Order(2))
oCustomer.Addresses.Add(New Address("Street 1"))
oCustomer.Addresses.Add(New Address("Street 2"))
[Code] .....
I created a website that contains a Webservice that transfers data to a windows application Using a collection, however, I get this Error that says that anything that inherits the ICOllection, it must implement Add(System.Object)
View 2 RepliesSay I have a interface called IProperties and I have a collection called colMyProperties that is a collection of IProperties. Then I have an object called clsProperty that implements the IProperty interface. Now, in my code where I add objects to the colMyProperties collection I add a bunch of clsProperty objects. so far so good.
Now when I try to access an object in the collection I can only access properties and methods of the IProperties interface, not the clsProperty object. What am I doing wrong? Do I need to cast the object?
Pages have Roles. Users have Roles. A user may only view a page if he and it share one or more roles.
This works:
Dim Allow As Boolean = False
CurrentPage.Roles.Load()
For Each r As Role In CurrentPage.Roles
r.Users.Load()
[Code]...
How can I make it compare only the Role Id values to determine equality?