Ways Of Shortening The Amount Of Code Used, Or Changing It?

May 6, 2011

(I'm using 2010 express), which includes, i think, very basic knowledge of coding. I have made a game in vb 2008 express before and it was a basic arcade game where you move your guy from the left to the right collecting points and dodging enemies that are randomly moving in the opposite direction that you are. Now I am attempting to make a sort-of user interface similar to that of the ps3 home screen, as a windows shell replacement app..

so far i have got what I am looking for in terms of moving between the menus, however the code that I have made seems very extensive for such a thing (in my opinion)..the question I am asking is whether there are ways of shortening the amount of code used, or changing it to be more efficient..if someone is willing to help, I will post my code, or upload my project (if given instructions on how to do so)

View 5 Replies


ADVERTISEMENT

VS 2008 - Shortening Some Code ?

Oct 12, 2010

[code]...

Also I would need some code like: For each item is x list: Msgbox(CommandList.txt(x).Text)

View 7 Replies

VS 2008 - Way To Shortening Code

Apr 30, 2009

Way to shorten this case method:

vb Select Case bgcolorVar
Case "red"
MyScripts.BackgroundImage = My.Resources.red

[CODE]......................

View 6 Replies

.net - C#: Different Ways To Run Code Asynchronously?

Feb 14, 2011

I have this code List<string> myList = new List<string>();

myList.AddRange(new MyClass1().Load());
myList.AddRange(new MyClass2().Load());
myList.AddRange(new MyClass3().Load());
myList.DoSomethingWithValues();

What's the best way of running an arbitrary number of Load() methods asynchronously and then ensuring DoSomethingWithValues() runs when all asynchronous threads have completed (of course without incrementing a variable every time a callback happens and waiting for == 3)

View 4 Replies

.net - Shortening A Repeating Sequence In A String?

Jun 30, 2010

I have built a blog platform in VB.NET where the audience are very young, and for some reason like to express their commitment by repeating sequences of characters in their comments.

Examples:

Hi!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
LOLOLOLOLOLOLOLOLOLOLOLOLLOLOLOLOLOLOLOLOLOLOLOLOL
..and so on.

I don't want to filter this out completely, however, I would like to shorten it down to a maximum of 5 repeating characters or sequences in a row.I have no problem writing a function to handle a single repeating character. But what is the most effective way to filter out a repeating sequence as well?This is what I used earlier for the single repeating characters

Private Shared Function RemoveSequence(ByVal str As String) As String
Dim sb As New System.Text.StringBuilder
sb.Capacity = str.Length

[code]....

View 1 Replies

Least Amount Of Code To Play Embedded Mp3?

Jan 12, 2010

Currently trying to do it with the wmp component but not sure how to get it to point to the resource file...

View 10 Replies

Determining Which Variable Has The Largest Value While Using The Least Amount Of Code?

Jun 4, 2010

Suppose I have 3 vars:

dim a as integer = 5
dim b as integer = 1
dim c as integer = 10

What is the most efficient method of determining which variable has the largest value while using the least amount of code? I know this can be done with if statements, but there must be a more elegant way to do it.

View 17 Replies

.net - C# To Code Converter - Reduce The Amount Of Copy/paste

Aug 29, 2010

I need a C# to VB.NET code converter, I want something that's ultra convenient, as I want to reduce the amount of copy/paste that I have to do... so could anybody give me some tips to what is out there? I want processing in bulk too, and to support the latest operations (LINQ, new VB inline-function support and all).

View 3 Replies

VS 2005 : Add The Amount Column Of The Dgv And Display The Total Amount In The Textbox?

Jan 21, 2010

i have a datagridview binded with the datatable via its datasource property....now i want to add the Amount column of the dgv and display the total amount in the textbox,if the amount is greater than a certain value then i want the cell to coloured red so i did this code and it worked great:

Dim i, j As Integer
For i = 0 To DataGridView1.RowCount - 1
j += Me.DataGridView1.Rows(i).Cells("Amount").Value
Next

[code]....

but my problem is that i want the red colour of the cell to blinkafter every 2 seconds....how to do this?i need to handle the timer tick event for this but i am not able to do this.....

View 2 Replies

Cover X Amount Off Nautical Miles At X Amount Off Knots?

May 4, 2010

im trying to make a simple program that calculates the time it takes to cover x amount off nautical miles at x amount off knots, the code i have so far is this :

Code:Public Class Form1 Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

[Code]...

so if i say want to cruise 29 miles at 12 knts it gives me an awnser of 2 hours 24.6 mins instead of 2 hours 25. Although i do realise that 2 hrs 24.6 is technicaly right i was wondering if anyone here could help me with getting it into the correct format?

View 4 Replies

Get Amount Of Money User Has And Doesnt Go Over Amount Hechecked

Jun 7, 2011

im trying to make a fast food program on which the user will input the amount that he has, then he will check on what he wants, by using check boxes. There are 7 different check boxes with 7 different amounts of money. I have the program somewhat finished (thanks for the people that helped me before) but theres still a couple of things that I still need to get finished but I dont know how to.I need to be able to get how much money the user has (this will be entered threw a text box, I think I accidentally messed this part up, because I cant get it to work right, (theres alreasy a permit amount of money in there and it needs to be what the user enters instead of the permit, 5.59, one) and this will be the maximum amount he can spend, then the user will check on the food he wants (and the program will add the sales tax also) then it will produce an answer saying if you have enough money or if you dont. But what im confused on is how do I get the users amount of money and make it the maximum mount he can spend and make sure it doesnt go over the amount that he has checked.[code]

View 1 Replies

Coversion Of Amount In Figures To Amount In Words

Nov 25, 2009

I am working in a point of sale system in Vb express 2008. I want to convert the Amount in Figures to Words like: How to conver the amount of $ 1,550,325.45 to Amount in words as DOLLARS: ONE MILLION, FIVE HUNDRED FIFTY THOUSAND, THREE HUNDRED TWENTY FIVE AND FORTY FIVE CENTS.

View 2 Replies

Coversion Of Amount In Figures To Amount In Words?

Nov 25, 2009

I am working in a point of sale system in Vb express 2008.I want to convert the Amount in Figures to Words like:How to conver the amount of $ 1,550,325.45 to Amount in words as DOLLARS: ONE MILLION, FIVE HUNDRED FIFTY THOUSAND, THREE HUNDRED TWENTY FIVE AND FORTY FIVE CENTS.Please advise how to code for that in Vb express.

View 5 Replies

Calculate The Amount To Save Up To A Certain Amount?

Mar 13, 2011

how to calculate the amount needed to save up to a certain amount.

Private Sub btnCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim dblSavings As Double
Dim dblFuture As Double

[code]....

View 3 Replies

VS 2008 Changing Old Code To New Code

Jul 3, 2010

Using This code from an old post of mine how could i change it to label1 label2.[code]

View 10 Replies

VS 2008 - Code Error On Tax Calculating Program - User Enters The Item Name And Amount Of The Item Purchased

Feb 9, 2010

So i've to write this program whose purpose it this:

Purpose: The user enters the item name and amount of the item purchased. The program calculates the tax for the item and the final total, and then displays these values. Tax on all items will be 7.75%.

And so far i've this code but it's not working:

' Program: Cash Register
' Author: Nidhi Shah
' Date: February 2, 2010
' Purpose: The Cash Register Window application will
' computer the tax and the final cost of a
' purchased item.

Option Strict On

Public Class frmCashRegister
' Tax per item - used in multiple procedures
Const _cdecTaxPerItem As Decimal = 0.0775D

[CODE]...

View 6 Replies

Changing Inner Code?

Apr 24, 2012

if its possible could i temporarily change the inner code of a program instead of using a timer or multiple buttons ex: i have a BUTTON1 set to open a webpage like [URL]how be able to do something like this

Private Sub BUTTON2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
if textbox1.text=1 then
button1.code=me.close

[code]....

View 9 Replies

Changing Dates On A Code?

Sep 18, 2010

iv been looking at this code and basically what the code does it runs a report every month, but I want to make some changed to it i.e. how its laid out within the PDF document for testing this I don�t want to run the hole report because it will take forever as you can see it starts lowerDate = "01/JAN/1900" And for testing ideally I just want to run last month so am I right in saying if I change the date from 1990 to 1/8/2010 and then change upperDate = Format(Date.Now, "dd/MMM/yyyy") TO upperDate = Format(Date.Now, "31/08/2010") would that work?

Imports MSXL = Microsoft.Office.Interop.Excel
Imports System.Configuration.ConfigurationManager
Imports System.Xml

[code]....

View 3 Replies

Changing Direction Of The Code?

Mar 5, 2012

Anyway this is my code right now so I am not blank.Code removed.Not sure if it is very hard to understand but I am currently working on a project and what this code does is finds a blue ball on thewhole screen then moves the cursor position on the blue ball it just found.If it doesn't find it, will show a msgbox Quite simple.

View 12 Replies

Changing Font Through Code In Rtb?

Jun 29, 2009

I want to change the font of text in rtb using code, not thru font dialog. e-g if i want to write all lowercase letters in "Arial" and all uppercase letters in "Times New Roman" then how can i do that. i hav tried using Text1.Font = New Font("Arial", 36, FontStyle.Regular) but it changes the font of whole text.

View 3 Replies

Changing Up This Code (HWID)?

Mar 7, 2012

i have been trying to figure out auth system and after tons of researching and asking questions, I found a tutorial that "almost" fits my needs. This is what the code does:Basically a new form is created with a textbox and a connect button on it. When the program is loaded, the textbox has your hardware ID on it (also known has HWID). Then it looks for that HWID on a text file of the link given [URL] in this case as an example. If that HWID is found on that text file, then it leads you to form2 which is an actual program and if not, form1 closes meaning you have no access to anything at all. A basic authentication system and here is the code for it:

Imports System.IO
Imports System.Management
Public Class Form1

[code]....

View 1 Replies

Changing Font Style Using Code?

Apr 6, 2009

Changing font Style Using Code

View 1 Replies

Changing The Position Of Textbox Using Code?

Jan 22, 2010

In my form there is a AXVS Flex Grid and a textbox.Firstly the textbox will not visible. When the focus will be on a particular column of the flexgrid then the textbox will be visible and the flex will be disable.The position of the text box will be at the bottom of the particular row at the first time. But when another row is inserted then i need to change the position of the textbox to the botoom of the new row and so on.

View 1 Replies

Convert The Application To ASP.net Without Changing The Code

Apr 23, 2011

I want to ask is there is any way to convert the VB.net application to ASP.net without changing the code..

View 1 Replies

Export To Excel - Changing Old VB Code?

Dec 30, 2009

I have been changing my existing code over the past week and have not successfully been able to export to excel in the format that the users are request. I am new to this job, learning vb through training videos, and have been given the task to update problematic old code and interfaces.The users cannot export large amounts of data. They receive a runtime error. The users do not want the export to html.The users do not want the controls to be exported.

[code]...

View 3 Replies

VS 2005 Changing Structure Of Code?

Jun 24, 2009

How do I change the program path '"logic.txt", "G:"' in the code below to theOpenFileDialog.FileName? Cos when I tried it, I receive String conversion errors and I tried altering the codes but it didn't work out well

vb.net
Sub Button1Click(ByVal sender As Object, ByVal e As EventArgs)
Dim sb As New StringBuilder(260)

[code]......

View 1 Replies

VS 2008 Changing CRC32 Code?

May 3, 2012

I am making a program for a game to change the textures. But when you edit an image file(the texture) it will change CRC32 and the game will notice you changed it so if you start the game the texture will just become grey. So what I want is that you can change the CRC32 code back to the old one that the game wil recognize and the texture won't turn grey. Now I found the CRC32 calculation on the internet but I can't figure out how to change it to the code you want.The CRC32 calculation class:

Option Explicit On
Option Strict On
<System.Diagnostics.DebuggerStepThrough()> _

[code]....

View 8 Replies

[VB 2008] Changing Code Via TextBox?

Mar 6, 2009

say i have a TextBox1.Text on form1 how would i have it where i input code through the textbox and then it replaces what they put with the actual source(Form1

View 5 Replies

IDE :: Changing Code Editor Appearance From File

Jul 28, 2011

How do I change the appearance of the Code Editor in VB 2008 Express (background colors; font, etc.) from a file that I have ?. I've tried changing the appearance by using the Import & Export Setting in the Options menu, and although it goes to successful completion (or so it says), it doesn't change the appearance at all.

View 1 Replies

Possible For VB Code To Do EXPORT All Of Them To NotePad And Not Changing The Position?

Feb 28, 2011

I have one Form and on Form having Labels , TextBoxs, ListBoxs and RichTexbs.It possible for VB code to do EXPORT all of them to NotePad and not changing the position

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved