Clearing A Variable - Using A 'frest Template' As In A Clear All Previous Settings
Jan 21, 2012
the code below is for creating controls at runtiem, but i have realised even tho i remove the controls and then add controls, they are keeping their settings and more so the Data, eg the checked list boxes are keeping their data so if i do some work with 1 of the 3 pannels then when i change the pannel im working on it still has its lists, how would i go about using a 'frest template' as in a clear all previous settings just so their isn't any possable errors.
[Code]....
View 1 Replies
ADVERTISEMENT
Nov 6, 2008
I am creating what could amount to quite a few temp files on a terminal server using the System.IO.Path.GetTempPath. My question is this. Can I trust Windows to clear that directory on a regular basis or do I need to clear it in code?
View 4 Replies
Jan 19, 2012
I am using web browser control in one of my forms for displaying html files (local files). Before I load the next file I want to clear the webbrowser control of the previous page. I am trying the following method which I found while searching the net.
private Sub ClearWebBrowser(ByVal wb As WebBrowser)
Dim tempDoc As IHTMLDocument2 = CType(wb.Document.DomDocument, IHTMLDocument2)
tempDoc.write("")
tempDoc.close()
End Sub
I have added the reference for mshtml namespace in com tab. When trying to run the program, error is thrown like "Type 'IHTMLDocument2' is not defined. (BC30002)".
View 2 Replies
Dec 6, 2009
I have several forms that are "reused," or vistited more than once per each time in the whole program. In VB6, using Form.Show() would show the form in its original state (the state is was when created in the designer). After closing this form (Unload Me), showing it again would still show the form in its original state.
I am coding in VB.NET 2008, and noticed that when I reopen a form I had closed during a session using my program, the form is in the state it was when I closed it (labels and listboxes filled with data), and not in its original state. I currently have the Form.Closing event filled with code to clear all of the controls, but I think that there must be a better way to "clear" or "reset" the form.
View 10 Replies
Mar 2, 2009
E.g. default setting for serial port after start up is COM1. If user sets COM2 and restarts program, is it possible to store port setting, COM2, other than still start from COM1?
View 5 Replies
Jun 20, 2011
If I modify a program of mine in some parts, adding also some settings in My.Settings and changing version, then I have to compile and create a new installer with the dear old InnoSetup.
Then I install the program, I go to see the settings ... and I see that them are the default settings stored in the MyProgram.exe.config file shipped with the new installer.
But is absolutely easy that a user would have changed the settings in a previous version (if existing) of the program.
So now the question is: during the new installation is there some clean and tested method to retrieve and update the settings set by users in any previous version of a program?
View 3 Replies
Dec 18, 2011
I have a byte variable that stores picture. How to clear the value of this variable.#
View 2 Replies
Feb 2, 2010
'ValueNow is updated by an external link eg ADO.NET
Dim PresentValue as Decimal
Dim PreviousValue as Decimal
[Code].....
View 6 Replies
Aug 18, 2010
I want to set a variable date in the format Y-m-d 20:00:00 of the previous day.
View 3 Replies
Jan 12, 2009
when the form loads, there is a table and i use code to set the row count to a variable from a previous page. this works fine. the problem i am having is that i cant get the row height sizes to be evenly spaced, there is 1 huge row then heaps of tiny ones.
View 7 Replies
Jun 12, 2009
i am trying to retain the value of a variable from a previous page. i believe this is the C# way to do this, but i would like the vb.net way can someone please help:
TextBox myTxt = (TextBox)Page.PreviousPage.FindControl("previousPageTextBox");
currentPageTextBox.text = myTxt.Text;
i would like to know how to code this in vb.net i tried this:
Dim myTxt As TextBox = CType(Page.PreviousPage.FindControl("Textbox1"), TextBox)
TextBox1.Text = myTxt.Text
but i got this error msg:use the new keyword to create an object instance
View 2 Replies
Sep 12, 2009
When the clear button is clicked on my interface I need my variables that are set as doubles to clear...I tried setting them to zero but that messed up my equations and caused more problems. Is there some method in double that clears them out or sets it back to nothing.here's the coding
'button i need to clear my textboxs and variables
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
[code]....
View 1 Replies
Jul 29, 2009
Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go.
While this is a mild annoyance in development, it raises the question as I approach deployment/release - if I use the app.config to store my user settings, will the user's personalized settings be hosed every time they install a patch that changes the version number of my app? If so, is there an easy way to "upgrade" the settings from the previous release? I know that using HKCU in the registry is another option, but I like the ease of the My.Settings namespace, and I'd like to stay with app.config.
View 2 Replies
Aug 20, 2011
In VB.NET,I want to create template at runtime and save it the template with name. for ex : Administrator design a page with 5 fields like using firstname, lastname, dob,nationality and job. He want to assign this page to the user with some restriction like user1 need to enter the all the fields and save it the forms as user1profile, but user2 need to enter only firstname and lastname and save it as user2profile.(in features, he can remove the fields from the form).
View 1 Replies
Aug 4, 2010
I'm working on my first T4 code generation tool to add some Stored Procedure helper code to my project. I've created custom types (e.g. StoredProcedure and StoredProcedureParameter to help with my code generation and have included the assembly and namespace references in my code:
<#@ template debug="false" hostspecific="false" language="VB" #>
<#@ output extension=".generated.vb" #>
<#@ assembly name="$(TargetPath)" #>
<#@ import namespace="StoredProcCodeGenerator" #>
This allows me to use my custom types in my T4 template code. However, because my custom types exist in the same project as the T4 template code, I can't recompile my project once I run the template code without restarting Visual Studio. This isn't very much fun.
I read a great article that addresses this exact issue by using the T4 Toolbox, but it's not working. Either I'm implementing the VolatileAssembly directive wrong or the T4 toolbox simply didn't get installed. I'm not sure that the toolbox got installed correctly (I'm using VS 2010 on Win XP).
View 3 Replies
Jul 16, 2011
In Datagridview, Set as DatagridView1.ReadOnly=True,
Dgv1.Rows.Add()
When i tried to add a Row, it is copying previous Row data to new row,and also blank the previous row, why?Like Insert Row, Why...?
View 7 Replies
Aug 9, 2010
This is a quite strange problem. I have set a setting variable in Application settings with following data:
[Code]...
Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county) It alerts 1. Despite being the first to be executed as soon as form loads.
View 1 Replies
Apr 21, 2011
I'm going to describe what I'm trying to do and then what I'm doing in hopes of making this as clear as possible.I'm trying to create a way of having data avaialble to the application that could be changed in the future and not have to recompile the code.Normally I do this for my connection strings incase something changes, this way I can just change the file and I'm good.however in this case I'm trying to store a long string variable that contains something like(including all " in the string) "Dear " + emailRecp + vbCrLf + "Thank you for buying our product...."
Now when I do this as part of the code with something like strMessage = "Dear " + emailRecp + vbCrLf + "Thank you for buying our product...."when I look at the output from this it looks like (which is what I want):
Dear Mr Smith
Thank you for buying our product....
however when I do strMessage = My.Settings.purchaseMessage (even with .ToString()) the output looks like Dear " + emailRecp + vbCrLf "Thank you for buying our product....how to do this in another manner that won't affect performance.I have also tried to trim the " from the first and last char positions and no luck.
View 5 Replies
Jun 4, 2011
[Code]...
The problem is I need to preserve all previous coordinates so I ReDim Preserve but I need to do it to the Class. And I try this and the NodeCoords variable is set as "nothing" when i am debugging realtime.
View 4 Replies
Aug 13, 2009
i want to save a variable to application settings and i dont want it to be in my invisible textbox1.text. i just want a plain old variable that i can manipulate during runtime and then have it save it after i reload the application. what do i do instead of attaching my.settings to textbox1.text?
View 1 Replies
Aug 12, 2011
this website seems great and this is my first post. Sorry if this has already been answered but I have been searching for a long time. I have a program with a list view in details mode. I have it load column settings (visibility, display index, width, etc.) when the form is opened and save them when closed. There are many columns...about ten so far...like folder, file, size, etc. Is there a way to access variable names from the values of other variables?
[Code]...
View 3 Replies
Dec 13, 2011
this is currently my code to clear my 5 textboxes
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
View 16 Replies
May 17, 2009
I have a timer that runs every time by itself, and for the code the runs in it I would like to have it clear the dataset before it does anything, the timer runs every 10 seconds, so I tried to do dataset.clear but it would crash if the dataset had no values
View 4 Replies
Jun 23, 2011
in hyper teriminal when i press "ctrl+L" is to clear terminal screen how to write the code in vb.net? Hyperterminal is connecting to serial comport.when i try this it work and return line on debug
serialport.writeline ("at+cmgl=1")
i try this but not work and it still show some lines on debug
serialport.writeline (vbcrtl +"L")
serialport.WriteLine("vbCrLf + l")
View 6 Replies
Aug 2, 2009
I want to hear some discussion regarding what is the best way to persist program parameter and variable settings from one run of the program to the next. I used to often use the ubiquitous INI type file in VB6 programs but I am aware that these are not formally supported in .Net programs. I also have a major aversion to adding to the already overwhelming bloat of the Windows registry by using that to store values.
[Code]...
View 6 Replies
Sep 20, 2010
way to clear textboxes in VB.Net and what is the difference between the two methods? I have also seen people be critical of folk using clear objects on their forms and i can see why but in this case, i am only learning.
txtbox1.Clear()
or
txtbox1.Text = ""
View 3 Replies
Jul 15, 2009
wan to ask about anyone know the code about how to clear all the data inside the data grid view without clear the binding source...
View 1 Replies
Jan 13, 2011
The company has been using Visual Studio 2008 and .NET Framework 2.0 for approximately 2 years. During that time we released several versions (4.x.x) of our program to the public and were able to preserve the user's settings using My.Settings.Upgrade.During the past development cycle we upgraded the program to Visual Studio 2010 and .NET Framework 4.0 and changed the version to 5.x.x. Now, when a user upgrades from 4.x.x to 5.x.x they lose all of their settings.However, in all upgrades after that point (ie 5.0 to 5.1) all the user's settings are once again preserved.I checked C:Documents and Settings<USER_NAME>Local SettingsApplication DataCompanyName and it contains two directories:
ApplicationName_Url_aaa ApplicationName_Url_bbb
where aaa and bbb are 32 character strings. All of the user.config files for the 4.x.x releases can be found in the ApplicationName_ Url_aaa directory. All of the user.config files for the 5.x.x releases can be found in the ApplicationName_Url_bbb directory.Based on this information it seems like something changed when we converted our program to VS2010 and Framework4 that is now causing a different 32 character string to be generated. However, we have been unable to track it down.
View 9 Replies
Jan 3, 2012
I have the following structure:OLD: frmMain (WinForm)uscStat (UserControl with Grid) In frmMain I'm able to make some settings and load the result of the settings via LinQ into the Grid of the uscStat.
[Code]...
View 1 Replies
Jan 14, 2009
I just wondered if you can or can't save arrays using the settings system object. There seems to be no way of entering it at designtime. It seems implied you cannot create new user settings.subobjects at runtime. I'm looking to find the easiest way to save a populated array of PictureBox's. If the only way is a self/custom made/managed .ini file then I need to know so i can start on that but I was hoping to use some of all this phaff in the new frameworks usefully.
View 3 Replies