I can't get is to save variables permanently. For instance, say you run your project and in the source code you have Button1_click s=textbox1.text (s is the variable I declared) Button2_click s=label1.text. Say you type some thing into textbox1 then click button1. Then you click button2. Is it possible to make it that the next time you run the program the text you typed into textbox1.text last time is displayed when you click button2? I am using windows form.
Im studying vb coding at the moment and im designing a reasonably small text based game using the windows console and so far i have a nice working game but the main problem is that the game restarts when you end the console, obvious i know. Been trawling through pages looking at different ways to save multiple variables for multiple uses such as a save/load feature and most pages have confused me, people asking for help with commands im not common with. So far i've tried using my settings to save the variables in a test program but can't get it to work?I have in settings a variable called gold with a scope of user as an integer and i have this code to try and utilise it
I am writing some code and want to check if certain things are in my database. Is there a better way than just creating a new string, performing the select and storing it in the string? I have to do this a few times for several items in my DB columns, but is there a way I should be doing this that would not require me to make a new string, and a new select for several items, well a better way? The items in my db aren't all strings and the data types vary.
Friend Class CellValue Public CellColor As Color = Color.White Public CellShape As Shape = Shape.Blank Public CellName As String = "" End Class
Then in my main I make an array of CellValue but I want to know if the values are also being passed down with the array.
Dim Plan(SizeW - 1, SizeH - 1) As CellValue Dim CellW As Integer = PictureBox1.Width \ SizeW Dim CellH As Integer = PictureBox1.Height \ SizeH
[Code].....
Are CellName, CellShape and CellColor being tied to each element in the array?. The reason is because I need to use these properties to tie certain functions to them. The CellName should have a MachineID which I would have to use to pull some info from a Database.
The Array should also be serialized and deserialized to XML as customer needs to create/edit and delete certain values in the array. And in order to save the array has to be in XML
So the Questions are does it save the CellName, CellShape and CellColor for each element, will it be affected if I serialize and deserialize using XML. If possible, how can I call up the Cellname p.e for a specific array element.
I know this is a VB.Net messageboard, but it can work with in all languages. Is there a quick way to complete a line (sample code): //Setting variables set 1 a = e; b = f; c = g; d = h; .....
//Saving changes set 2 e = a; f = b; g = c; h = d; without having to type everything out...A technique using EXCEL or Notepad....Find and Replace. This would save a lot of time coding and becomes pain in the butt when you working with many variables.
<pre-question blab>// skip if you want Might as well consider me new, as I haven't programmed in years, and that was only tinkering in Java. Trying to get back on track a bit, so starting with VB to get the feel going to continue learning. I don't mind putting in the effort to learn and look up, I just am not 100% sure what I should be looking into at the moment... Old programming I did was nothing advanced, only little things like calculators, notepad-esque writers, and that sort.</pre-question blab>
I'm BASICally wanting to know what I should look into for saving multiple variables of a custom class object to be loaded later. I've seen some things about text, and I can do that fine, but don't think it would be the proper/best way of handling things at all. I also saw some talk of XML, SQL tables, etc. I just need a point in the right direction.
For a bit more info on my actual project, I was tinkering with a 'simple' program to allow users to create rooms/objects/etc., which will then be converted into Inform 7 language (an interactive-fiction language).The variables needing stored are objects with a number of string variables and integer variables. I need to be able to save those, then load them out later into an array of said objects.
For anyone needing a more VISUAL image of what I mean, here are a few screenshots to show you what I mean. Also, if anyone has ever used Adrift, it is (at the moment) very similar to it, but for the Inform language.
I have an MVC application which sets some session variables based on internal static IP addresses.I have built an ApplicationController to override the OnActionExecuted sub in MVC for data that I need to use throughout my application.However, the code below, which is just a snippet of my code but is edited for my post, only partially works. On initial page load, the session variables aren't saved, but after a page refresh they are. The issue I have is that these need to be saved on the initial page load.
If Session("Item1") = Nothing Then If IpAddressShort <> "" Then Dim locInfo = cmsRepository.GetInfoBasedOnLocation(IpAddressShort).SingleOrDefault() If locInfo IsNot Nothing Then
[code]....
Theoretically, if I'm correct, if there is no Session("Item1") set/if Session("Item1") is empty, then the rest of the snippet should run and set those variables.How come this isn't setting those variables on the first time the page load?
I'm looking to be able to save and load the content from multiple structured arrays and variables into/from an encrypted file, is there any reliable source of information or tutorial that I'd be able to use for this? I've never written a program in visual basic that writes to/reads from a file.
I am pretty good with visual basic and visual studio, but the one problem I have is saving... I am currently creating a game, and it has a lot of variables, I want o be able to save all those variables to a text file and then re-open it later. When it is open, i want the variables to have the original value from the text document.
To sum it up: I need variables to be saved in a text file, and then be able to open the text file back and have the variables have the proper values from the text file.
I have been searching around google, and I found ideas, but I have no idea how to use them. Like using XML or saving a table with " TextFile.WriteFromTable" "TextFile.ReadToTable" but I don't exactly get how to use those (the posts weren't too clear)
1: counting button clicks and saving them to a variable and adding two. For example, if a button was clicked 10 times, the value of the variable would be 12.I would start with:Dim Buttoncount As IntegerButtoncount = ....This is the part i dont know. I would think it would be something like button1.click.numberofclicks or something, but i cant find anything that works
i am doing with deleting row permenately from database currently,but the problem i face right is that i can delete row from datagridview only, but the data inside database remains unchange.I want to delete a row which i selected determinately when i click a delete button .
Here is the code that i written...
Private Sub Delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete.Click conn_1.Open() Dim sqladapter_1 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("select * from Table_1", conn_1) sqladapter_1.Fill(sa, "Table_1")
i add a datasoure from sql server and VS create a file : ExampleDataSet.xsd..Now i want to remove that datasoure. i tried to remove ExampleData Set.xsd file and VS show many errors. how can i delete permanently that datasoure ?
How can I keep table in my application Permanently. after colse the application the table will be there. When I need I will able to sohow the Tabel in datagrideview.
I keep table in my application Permanently after colse the application the table will be there. When I need I will able to sohow the Tabel in datagrideview.
I have been researching on the possibilities of programmatically burning comments on pdf files permanently but so far I have not been successful. Has anyone writen code to do this or point me in the right direction? Permanently burn comments into pdf?
I am implementing an application in vb.net about a library management system, when I add new record to the database and then close and reopen the application, the record is not there!
I googled the issue and used the text book of this course but nothing beneficial.
at my collage we have to rename all buttons and labels to represent the type of thing the button, label or text box etc do For instance if I had an OK button I would change the Text and (Name) of the button in the Properties section from Button1 to BtnOk, if it is a Label I have to change it to LblOk etc I was wondering if there is a way to change the default (Name) Button1 to (Name) Btn1 and so on so that I only have to click on the 1 and type my description, rather than having to type the abbreviation for the type of object every-time also ?
I'm currently trying to delete data from a dataset/datasource/database using visual basic. So here is the run down: I've built a program that can add, delete, and modify customer information from an Access database and I just got the add function working. Meaning, I can now add customers to the database and it is sticking to the database. I re-ran the program and even restarted the computer the computer and the data is in the database. This works fine. However, now I want to get the delete button working but I'm not sure why it isn't deleting some of the fake entries I made just to test out the add feature.Here is the code I am using:
Dim delCompany As UMD3.CompaniesRow delCompany = UMD3.Companies.FindByCompany (NOT SURE WHAT GOES HERE) delCompany.Delete ()
created a class that adds a TextBox with some custom properties to the toolbox. But it's only available when the project I created it in is opened itself. I'd like to have available it in the toolbox at all times.
I made a customized TextBox that I'd like to permanently add to the toolbox. But when I close the project that I created it in, my new control also disappears and I have to copy/paste or import the class-code every time I want to use it. Is there a way to get the control in the toolbox "forever"?I tried to enclose the class in a "Namespace CustomClasses" statement and changed the root namespace in the project properties to "CustomClasses", but nothing of what I tried is permanent. I prefer to store my classes in a "real" root namespace, in the same root as the microsoft and system namespaces.
Im using the webbrowser control in my application, but i want to permanently change the user agent when im navigating to sites.
I have tried the extended use of the .Navigate function for the webbrowser, but when the user navigates the browser, or when im beeing redirected by the site it goes back to the vb user-agent info.
Alternatly: Is there any way to catch the postinfo and http headers when the webbrowser control navigates to a new url?
I need to permanently store a string or maybe a object in my application. And yes, I have tried the application settings (My.Settings).
My.Settings.something = "hi" will save "hi" into something, and when i use msgbox to output the data, it works. The thing is; when I copy my application to somewhere else on my computer it is gone. I guess the settings is saved to some file at the filesystem, and when I move my file it also creates a new settings file. How can I store a string inside my application, and also move the application later on?
i have taken one combobox in form1, another in form2. when i want to add an item permanently in combobox in form1 it should automatically added in the form2's combobox permanently and at the same time it should be added into the database(ms access) also.
I binded a datagridview with datasource, But its order was changed then I used Columns("ColumnName").DisplayIndex property to arrange the columns of DatagridView. Now I am exporting this DataGridView to Excel, All things are right but problem is about the column positioning, Columns in excel file are shown in wrong order (it shows order before I applied Columns("ColumnName").DisplayIndex property to arrange the columns of DatagridView). My question is that how I permanently change the Column index of DataGridView......?
Public Sub gererateReport(ByVal dg As DataGridView) Dim oExcel As Excel.Application Dim oBook As Excel.Workbook Dim oSheet As Excel.Worksheet Dim oMissing As Object = System.Reflection.Missing.Value [Code] .....
I have a listbox that loads all text files in a set folder on form load. From those files in the list box, I want to permanently delete a file from my pc, thru a button that I'll eventually add a yes/no msgbox before deletion. Just to click on a file in the listbox, then the delete button and delete the file.
I created some custom controls which I use quite often and I thought if I add them once to my ToolBox they just will be there next time I start up VS2008; however, that does not seem to be the case! Each time I start VS2008 I have to re-add that controls (which is quite annoying!). Is there a trick / way of having them there permanently?
I'm trying to figure out how to do this as I'm not sure what's the proper way of doing this.
I've got several strings that I want to store/save permanently, even after the application is closed. How should I proceed? Do I read or write from a textfile?