VS 2010 Code Cleanup?
Sep 13, 2010
I have the following code, I was wondering if anyone could show me a way to clean it up abit, it's a bit bulky and repetitive and I am just looking to slim it down.
Public Sub RefreshList()
Dim Button As New ListViewGroup("Button")
CodeKeeper.lvCodeList.Groups.Add(Button)
[code].....
View 3 Replies
ADVERTISEMENT
Feb 17, 2009
I know that this is not the best way of doing this, so I am looking for suggestions for cleaning this up. Currently, it only allows the user to enter Alpha characters, spaces, and press the enter and backspace key in a textbox.
'allow alpha characters, spacebar and backspace key only
If (e.KeyChar < "A" OrElse e.KeyChar > "z") _
AndAlso e.KeyChar <> ControlChars.Back AndAlso Asc(e.KeyChar) <> Keys.Enter AndAlso
[code].....
View 3 Replies
Jan 20, 2010
The documentation for an API I am using explicitly says that I need to call close() on an object when I am done with it. I would also like to log something there.I understand GC, might not happen at expected time, etc. etc. I still want to implement some code at cleanup.I read that I need to Override Finalize() to do this.I wrote a console app to test and it looks like it indeed works.However, this does not work with windows forms. I put a break point and it never gets hit in the Finalize method.How do you add some code to be executed at cleanup time for a window form?Here is my console app test:
Public Class Foo
Public Sub New()
Console.WriteLine("In Foo Constructor")[code]......
View 2 Replies
Feb 15, 2010
I have a hard problem here: how to cleanup the no use memory from the RAM?
[Code]...
I have a container that need to add many PictureBoxes with a quite large image, then i need to clear all PictureBoxes and create some new ones. like this: If I click the button some more times, my computer will be out of ram, whatever how many ram do your computer have.How can I dispose all the things used in Graphics and the controls in FlowLayoutPanel1 but not disposing the FlowLayoutPanel1 itself?
View 4 Replies
Mar 20, 2011
We currently develop and deploy various applications in our business. Over the weekend, I have decided to develop a multi-use installer and update programs based on conf and command line arguments, works great.
[Code]...
View 2 Replies
Nov 29, 2010
I am trying to format xml entries I have so that I can use the xmltextreader without getting errors. I added a default header and footer in the event I notice there is no opening or closing tags. I remove illegal characters and check for unicode but I always find an issue where an entry slips in and gives the error:data at the root level is invalid and when I check that entry is slipped through the cleaning process or just has an unmatched tag somewhere. Now I use
Dim stringSplitter() As String = {"</entry>"}
' split the file content based on the closing entry tag
sampleResults = _html.Split(stringSplitter, StringSplitOptions.RemoveEmptyEntries)
to split my xml into individual entries before I start the cleanup process. Here are my default headers;
Private defaultheader = "xmlns=""http://www.w3.org/2005/Atom"""
Private headerl As String = "<?xml version=""1.0"" encoding=""utf-8""?>" & vbNewLine & "<entry " & defaultNameSpace & ">"
Private footer As String = "</entry>"
is there any tool in the .net framework that can detect and cleanup unmatched tags so that I can get this to work
View 1 Replies
Jun 8, 2009
I have this basic code for cleaning up old files
Imports
System
Imports
System.Data
[code]....
The only variable is the directory path. I have the directory created and there are a few .txt files in there that should meet the criteria. However, when I run it in SSIS, I get the following error (short version) "The element cannot be found in a collection."
View 1 Replies
Jan 19, 2012
The following code for DISC CLEANUP works on Vista and windows 7 but not on XP?
Drive = "C:"
_process = New Process()
With _process
[code]....
View 5 Replies
Mar 10, 2011
I've had 2008 express on this PC since it came out -- I basically have ONE important project that now is being troublesome.
Just had an "unhandled exception" and "configuration system failed" -- errors I've never received before and I've just made minor changes to the program.
For one, I was thinking about a fresh install of 2010 express (but remember some real problems when I upgraded from 2005, so ??) be afraid ? very afraid?
ALSO --
What are the mandatory files I need to save in a project folder?
If I delete the bin and obj folders (plus?) and let it write new ones will that sometimes cure some problems?
What is a good way to SAFELY keep all your hard work but get rid of possible clutter and ?
Configuration system failed to initialize --
View 6 Replies
Nov 29, 2010
I am trying to format xml entries I have so that I can use the xmltextreader without getting errors. I added a default header and footer in the event I notice there is no opening or closing tags. I remove illegal characters and check for unicode but I always find an issue where an entry slips in and gives the error: data at the root level is invalid and when I check that entry is slipped through the cleaning process or just has an unmatched tag somewhere.
Now I use
Dim stringSplitter() As String = {"</entry>"}
' split the file content based on the closing entry tag
sampleResults = _html.Split(stringSplitter, StringSplitOptions.RemoveEmptyEntries)
To split my xml into individual entries before I start the cleanup process.
Here are my default headers:
Private defaultheader = "xmlns=""[URL]"""
Private headerl As String = "<?xml version=""1.0"" encoding=""utf-8""?>" & vbNewLine & "<entry " & defaultNameSpace & ">"
Private footer As String = "</entry>"
Is there any tool in the .net framework that can detect and cleanup unmatched tags so that I can get this to work.
View 5 Replies
Jul 24, 2009
I tried to put everything about Cleanup Routines toegether i've read! Do you think that makes sense? It works...i just want to know if its reliable and efficient.[code..]
View 1 Replies
Dec 23, 2010
After I ran a disk-cleanup (in my case AVG PC-TuneUp), the loading of my VB.net project gave error on a missing file.Changing the build-configuration (DEBUG->RELEASE->DEBUG) would recreate the file and all is OK. But I have basic configuration-info for the build, maybe in more complex cases some important details could be lost when the file gets deleted.I would think an information as critical as that, would be placed in the project folder, or be part of one of the many files that make up the project, but not in the temp-folder.
View 7 Replies
Nov 21, 2011
Can the "Disk Cleanup" operation on Windows be disabled / enabled with a registry setting using VB.Net?I am using Windows 7 32 bit ultimate edition. but as a temporary measure I do not wish to do so.
View 4 Replies
Jul 19, 2011
This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.
[Code]...
View 39 Replies
Jan 18, 2012
I had a weird series of errors involving e.Graphics.DrawString() when painting a panel.I am using a barcode font [Code 128] with a library that converts text to the proper format for Barcode readers.That's fine, however, when I draw it to the panel, that's where things stop being fine:But, here's where things get funky. When I put it into a TextBox instead of drawing it via Graphics.DrawString(), everything is peachy:In fact, the TextBox one looks much better than the Graphics.DrawString() one! Am I doing something wrong?[code]
View 2 Replies
Jan 22, 2012
Wondering if it is possible. It works on the idea that all files share common code. The program would ideally analyse the source file and compare it to the reference files. It would then find common parts of the code and write it to a rebuild file. At the end the rebuild file and the reference files would then be able to rebuild the source file without it being present.
For Example.
source file code = xxyyzyzyxw
ref file 1 = xyxxzyzxwyy
ref file 2 = zxxwyzzywxx
The program would then analyse these files and make a rebuild file like the following
source(0,1) = ref1(2,3)
source(2,3) = ref1(10,11)
source(4,7) = ref2(5,6) + ref2(5,6)
source(8,9) = ref2(2,3)
Thus you would be able to build the source file using these instructions and the reference files.
View 1 Replies
Dec 6, 2011
when i put, for example, a picturebox in form and code some events. then i want delete that picturebox. well the code stills there. imagine that i use another picturebox i use the same name. now if i double click on these picturebox, the code editor recreates a new subs. can i disable these situation?
View 6 Replies
Mar 8, 2011
Ok i have this code on a button click hook
[Code]...
but if the checkbox is not checked then i want it to wait until it has copied the file before deleting it because at the moment it deletes it quicker than it copies it and the file could be different size everytime so i cant just put a simple timer of say for example 5 seconds in.
View 2 Replies
Oct 7, 2010
I am learning VB for the moment. I want to copy/paste code from a PDF to Visual Basic 2010 Exppress, but if i paste the (structured in PDF) code to VB, i get 1 long string of code and need to restructure it by entering after each line. Otherwise VB gives me a lot of errors. This is a time consuming work. Isn't there a way, VB puts the code in the right format?
View 4 Replies
May 15, 2012
wasnt sure here or games but code applies to vb 2010 more than a game so...Right, this is the second time i've typed this so i'll keep it brief( didnt post last time )im making an rpg game for the hell of making an rpg game and to display the players health im using a case select code which selects one of 20 jpg images depending on the percentage of the chars health (health / max health * 100)
Here is the code :
Select Case monsterhealth / monsterhealthmax * 100
Case 96 To 100
[code].....
View 2 Replies
Sep 11, 2011
I am trying to obtain the content of a web page displayed in an iframe in a Web Browser Control in Vb2010- While searching for this I came across the following C# code to obtain content of iframe. The person who has posted the code suggested that I can use the C# code in a VB.net application. I want to know, how to do this (ie how to use the C# code in a vb.net application)? [code]
View 1 Replies
Dec 22, 2011
Option Explicit
Private Const NULLPTR = 0&
' Constants for DEVMODE
Private Const CCHDEVICENAME = 32
[code]....
View 10 Replies
Jun 25, 2010
Prior to VS 2010 I was able to debug VB6 client code from the .Net IDE by setting "Start External Program" to vb6.exe (full path), or attaching to the running vb6 executable via "Tools->Attach to Process" and have execution stop at the required breakpoints in my .Net code.
Now with VS 2010 I seem to be only able to accomplish the same by setting the target framework to 4.
Is this a bug in VS 2010, or is there a switch/option that controls this?
View 5 Replies
Feb 16, 2011
At my old job we used batchscripts to start macro's in another application. These batch scripts would also write data about the status of the macro as loglines to a log file using VB.
I have saved the batchscripts when I moved to another job because I always thought they might come in handy. However I forgot to save the visual basic script needed to create and fill the logfile.
The batchscript would look like this:
SET SP=C: est
SET LOGFILE=C: est est.log
cscript //nologo %SP%logging.vbs "Script executed by admin" >%LOGFILE%
cscript //nologo %SP%logging.vbs "Starting Loading Data" >>%LOGFILE%
View 1 Replies
Jul 15, 2010
Can i use the code of vb2008 in vb 2010?
View 4 Replies
Oct 22, 2010
On my form i have 4 text boxes which need to show one of each of the following.
box1 the amount of years since 25/6/09
box2 the amount of months since 25/6/09
box3 the amount of weeks since 25/6/09
box4 the amount of days since 25/6/09
What would be the code for each of the boxes?
View 10 Replies
Jan 30, 2011
I made a simple VB application has a database created by SSMS and attached to it.Here is my form
Imports System.Data.SqlClient
Public Class Form1
Private cs As New SqlConnection("Data Source=STARMAX-PC;Initial
[code].....
View 2 Replies
Apr 25, 2012
Ok, getting a little frustrated. I'm a new VB programmer (just a few months). Let me show you the start of my code so you can see what I'm trying to do:
Public Class Form1
Dim crude1 As Double = 0
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
[code]....
View 4 Replies
Oct 20, 2010
i use this code many times on all my applications.but now i'm on windows 7 and changed the framework to 3.5 and the code does not do what it supose to do.If File.Exists(Application.StartupPath & "downloaded" & ListViewEx1.SelectedItems.Item(0).Text & "ar.exe") Then
[Code]...
View 3 Replies
Apr 13, 2012
I have 4 ComboBoxen and 1 DatagridView into one Form. I make a code, for binding with 5 tables, each is own dataSet and dataAdaptor Is it possible to use one DataSet and one DataAdaptor for 5 Tables, so my code become shorter.
I think the solution is a SQL SELECT query, but i dont no for sure.If it is a SELECT query, ore something else, cane anybody help with make the code i need.
[Code]...
View 4 Replies