VS 2010 Set 2 Variables To Be Equal

Jan 29, 2011

I would like to set stringa and stringb to be equal and then clear stringa like so:

Dim stringa as String = "abc"
Dim stringb as String
stringb = stringa

[Code]....

However this code sets up a link between the 2 variables, so when I clear stringa stringb is also cleared.

View 1 Replies


ADVERTISEMENT

XML To Variables - Setting Label To Equal Text Inside Tags

Jul 29, 2009

I have an xml document on the internet right. Lets say it contains:
<tag>goose</tag>
What I want to do, is when the user clicks a button in my vb form it looks for the "tag" tag and finds the text inside the tags which is goose. Then it sets a label to equal goose, or whats in those tags.

View 7 Replies

VB 2008 Why Are Static Variables Set Equal To 0 In The Declaration When 0 Would Be The Default Value Of The Numeric Variable

Apr 21, 2010

Why are static variables set equal to 0 in the declaration when 0 would be the default value of the numeric variable anyway when it's first declared? Not including the "=0" in the static declaration seems to work with no problem.

View 2 Replies

LINQ To SQL Select Equal OR Not Equal To

May 19, 2012

In the following LINQ query, i would like when the Loc=Locale.Gr all the records with GrID=100 returned and when the Loc is anything else all the other records with GrID <> 100 returned.How can i achieve this one? I tried something like the following, but it is totally wrong.

PrivateSub Test(Byval Loc as Locale)
Private Const GrID as integer = 100
Dim Query = From c In Mob Where c.CountryID = IIf(Loc = Locale.Gr, GrID, <> GrID) select c
End Sub

[Code]...

View 1 Replies

VS 2010 Function Returns Same Value / But When Checked To Be Equal Says Otherwise?

Mar 13, 2011

Code Block 1 First I am calling my function to obtain a pixel color at a specified coordinate.[code]The odd part is while looking at the results as a string they appear to be the same, but while using If Not TheColor.Equals() in code block 2 the program returns that they are different. Before threading code block 2 this was not a problem so I can only assume the threading is causing the problem. I'm unsure as to how I can fix this... Additional unrelated problems I am having are:

- On WindowsXP the colors being read are not the actual color as which the mouse is located.

- While using print-screen there seems to be a bit of lag and some times unreliability, is there another method to get a pixel color at a specified location? Note that GetForegroundWindow works on Vista/7 but not XP, and GetActiveWindow is unreliable.

View 5 Replies

Check To See If The System Time Is Equal Or Not Equal To A Specific Time?

Mar 8, 2012

How does one check to see if the system time is equal or not equal to a specific time? So, say I want to perform an action if your system time is between 6pm and 6am. Or something similar?

View 1 Replies

VS 2010 Add Tips To Variables In Sub?

Oct 26, 2009

Is it possible to add the tips to your code in the sub so the user know what part of the sub is for? Like if I create a sub like this:

Private Sub Stuff(ByVal Tip as String)
End Sub
When the yellow box comes up you might see something like:

Quote:

Private Sub Stuff(Byval Tip as string)

This is just some text you use in the sub, don't worry about it.

View 1 Replies

VB 2010 - Linking Variables To Other Forms?

Feb 13, 2012

I have already made my GUI with multiple forms using VB2010 and made buttons that would open and close them (me.hide and form#.show)My problem is how could I use a variable I've computed and displayed on a sub-total (cashier of sorts) to be used on the main form where it would display the bill on a listbox?Here's how the button works to compute for the item sub total

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cstotal As Integer

[code].....

View 10 Replies

VS 2010 Assign Same Value To Multiple Variables?

Nov 19, 2010

What is the cleanest way to assign a value to multiple variables? For example, how can I assign FALSE to each of Label1.Visible, Label2.Visible, Label3.Visible, Label4.Visible, and Label5.Visible.Is there anything like

code
Label1, Label2, _
Label3, Label4, _

[code]....

View 1 Replies

VS 2010 Button To Increase Variables

Dec 27, 2010

Still working on that overlay. I am stumped on what I think is my last function. I have a + and a - button that needs to control a text box that has numbers in it. For instance: TextBox1 shows the number 2 in it. When I click the + button I want it to increase that number by 1. It sounds too simple when I say this out loud, but I think I am stumped with this basic function. I don't know where to begin.

View 8 Replies

VS 2010 Checking Two Structure Variables?

Feb 7, 2012

I have the following structure:

Public Structure objKeys
Friend Shared [rsaPrivateKey] As String
Friend Shared [rsaPublicKey] As String

[Code]....

How can I check if these two variables have the same data?

View 13 Replies

VS 2010 Copying Db Fields To Variables?

Apr 5, 2011

I have been using VB a fair bit in the past developing a Access Database, recently I wanted to give my front end interface a bit more power so I have started learning VS 2010.

Anyways, I am still using Access for my databases and i am having a bit of trouble working with the data in VS 2010, what i would like is the following:

A way to form a string or integer from a SQL query (from a single field or multiple on that row) assuming the query will always return one row.

Then a way to write string or integer variables back in to db fields.

example:

Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|ItemRegisterDB.mdb")
Dim cmd As New OleDb.OleDbCommand With {.Connection = cn, .CommandText = "select * from tblItemregister where ItemID = 1"}

[Code]....

Example = ??? 'What would i need here to copy fields from that row to string?

View 4 Replies

VS 2010 DataSet - Using Variables In Query

Apr 26, 2011

I added queries to my dataset via the designer. Is there a way to use variables in those queries?

View 1 Replies

VS 2010 Delete All The Information Of The Variables?

Apr 2, 2011

I have declared a variable for all the controls of my form (Dim result As String) and when i close the form (me.close()) and open it again, the value of the result var don't go to nothing (""). Why is that happening? Close is actually the unload of the form. Shouldn't it delete all the information of the variables?

View 2 Replies

VS 2010 Dynamically Accessing Variables?

Feb 26, 2011

I have a script where I make separate routines with identical code

Example:
sub AddToA {
ATotal += 1
}
sub AddToB {
BTotal += 1

[Code]...

View 10 Replies

VS 2010 Public Variables For All Classes?

Mar 30, 2011

I have a MDI application and a very complicated class there which populates its properties from a dataset derived from an external database. Each form, including child forms have to be able to access that class and use its properties thorughout the whole session.I don't know where to 'preserve' these property values within the application. I kmow many books etc. suggest not to use public variables but I really can't find a way to solve this other than to use a public variable (which is a list(of my custom class) in this case.
I have a separate class called PublicItems.vb and declared there my public variable as

Public Shared secuniverse As List(Of myCustomClass)Is there something wrong with the syntax because if I try to use the variable secuniverse in my main application class, I get the following exception:'sectoruniverse' is not declared. It may be inaccessible due to its protection level.

View 7 Replies

VS 2010 Shared Variables And Threading Pin?

Mar 12, 2012

So I am currently attempting to wrap my head around create multi-threaded programs and I am currently running into an issue when using a Shared variable across multiple threads.The program is structured as follows: Public Shared IsActive as Boolean

Main Thread = GUISets the Value of IsActive through a Button ControlTwo Worker ThreadsBoth threads are while loops that read the IsActive Boolean Ex:While IsActive = True Do Work End WhileHowever when I change the value of IsActive from the Main Thread it causes the worker threads to stop (ThreadState = 16).

I have been reading that I have to synchronize/lock shared resources and have tried SyncLock and Monitor methods without success (it is entirely possible I am not using the above correctly, so If someone could provide proper examples for the above situation using the mentioned methods please share them).

View 4 Replies

VS 2010 Structure Variables Not Updating?

Sep 19, 2011

I have created a structure with some variables that I'm trying to update during the course of a sub routine but they are not updating, when I cycle though them at the end all the variables are still set to 0.

Imports System.Data
Imports System.Collections
Structure Team

[code]....

View 4 Replies

VS 2010 Updating Variables In Word

Dec 22, 2011

I am trying to populate some fields in Word document using DocVariable:[code]The proplem that I am facing is when I open the document after running the program the fields won't be updated, so I have to go each field and highlight it then > right click > update field to get the new value!I need a way to update them or my work will be meaningless.I forgot to say that the DocVariables are inside textboxes.

View 1 Replies

VS 2010 Working With Boolean Variables?

Jun 16, 2011

I am working with a multi form project. The long and short of it is that when i originally load form 1 ... all bool variables are false. Once i load form 2 and perform my operations some of my bool variables will be set to true.

I need to have some sort of object to listen for those changes. What i have come up with so far is the following. Private Sub patient_frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]...

The if statement will work but i need a way to make it keep looking for changes in the boolean variables.

View 1 Replies

VS 2010 : Share And Edit Variables Between Forms?

Jul 7, 2011

how to share and edit variables between forms? I want the user to be able to enter a value into a textbox and the program store it and then load another form and do calculations and display answers but I can't get it to work.

View 2 Replies

VS 2010 Class / Properties And Variables W/ MySQL

May 3, 2012

Ok so my boss told me that I can't use DataSet's and dataadapter and such like this because it isnt good for scalability. So, I must change the way I have my 28,000 records binded to my form. The problem is, I'm only 3 months in with VB.NET and I don't know of any other way to accomplish what I need to do. I was reading somewhere that I can use a Class as my "Order" and I can bind the variables/properties to the form and with this, I can navigate through records while having controls on each important part of the "Order". Unfortunately, I don't know what I'm doing, this is as far as [code]Any guidance as to what I am to do from here in order to pull the data from my database and bind to the property, then to a text box/combo box, and a way that I can use my binding navigator to go through the many records.

View 13 Replies

VS 2010 Unable To Evaluate Expression/variables?

Oct 24, 2011

I have one test class which having few variables declared in the header of the class where it will be accessed for all the subroutines and functions in the class. Here's the sample of my declaration:

Private m_dblMaxPwrLimit As Double
Private m_dblMaxPower As Double
Private m_intHalfPwrIndex As Short
Private m_intMaxPwrIndex As Short

After that, I have one Private Function which need to access some of the variables declare in above. Part of my function is show as below:

Private Function GetPmaxIndex(ByVal Serial As Short) As Boolean
Dim i As Short
Dim Total As Short

[code]....

The problem is when I step into the line of m_dblMaxPower and m_intMaxPwrIndex, I can't see the value of these variables which is suppose I can see it as in VB6. Additionally, when I put Add Watch for these variables, it showed 'unable to evaluate expression'. I guess it is not being used and I think something is wrong with my declaration but I do not how should I declare it corretly because as for VB6, we can declare all the variables in the header of the class and we can use it for all the subroutine/function within the class.

View 4 Replies

Import Spreadsheet Data Into VB 2010 As Variables Array?

Mar 19, 2011

My basic set up is Visual Basic 2010 Express on Windows 7 64 bit What I'm trying to do is to have VB 2010 get the data from a Open Office spreadsheet. I have looked around on the general interenet and have found quite a few references to MS Excel, but none dealling with Open Office. The code samples I have tried to use seem to rely on MS Excel being installed (Which I dont have). The 'Automate excel' page (Here: http://support.microsoft.com/kb/302094) naturally seems to rely on a Microsoft Excel Object Library reference that, not surprisingly, isnt there because I dont have MS Excel. Keep in mind I havent mucked around with a programming code for decades!

What I do have is Open Office 3.2, which CAN save spreadsheets in a excel format (.xls), and a few others such as .ods, .dbf and .xml (Excel 2003?).

[Code]...

View 1 Replies

Importing Variables Into Visual Studio 2010 Program

Dec 27, 2010

I sucessfully write a file containing variables with the following code:

Private
Sub
SaveConfigButton_Click(ByVal

[Code]....

The variables do not populate.

View 2 Replies

VS 2010 - Modules VERSUS Forms For Global Variables

Dec 19, 2010

I was a VB6 programmer. And back in the day global variables, functions and subroutines were put in a module. The program started in the module using a sub named Main(). Now in vb2010 it looks like using sub Main() is possible only for console apps, which is not what I want, I'm still trying to write a windows app but it looks like everything has to go at the top of the starting form?? How is this good coding practice? Shouldn't public vars and functions be in their own module?What is considered best practice?Are there any links that would walk me through the differences between vb6 and vb2010?

View 2 Replies

VS 2010 - Public Variables, Functions Are Not Visible In Form2

Jun 26, 2011

I've got a program that runs from one Windows form, Form1, with stuff declared all in that class: public variables, public functions, subs, etc. I decided that the form was getting cluttered, so I added one button to bring up a new form, Form2, and I put some of the buttons & check boxes for testing over there, so that Form1 can be more visually clean. Problem: when I go to put the code for the tests into the buttons on Form2, none of the public variables or subs or functions that reside in Form1 are visible in Form2. What statement/s do I need to add (and where) so that the public "stuff" that's declared in the class for Form1 is visible within Form2, please?

View 6 Replies

VS 2010 Make VB Read The File And Put The Information In The Right Variables?

Jun 22, 2011

Im creating a game like CityVille where you create a city and such. The game allows you to name your city and such and because I dont understand how to use the settings thing to save stuff I want to use a text file. I want the textfile to look like this:

city_name: namehere
money: moneyhere
plots: plotshere
population: pophere
smallhouseowned: numberhere
etcetc

How do I make VB read the file and put the information in the right variables?

View 11 Replies

VS 2010 Storing Variables - Access And Use On Several Windows Forms

Apr 5, 2011

I've got a dictionary<string,string> that I need to access and use on several windows forms. In asp.net, I could store it in Session and use it from any aspx page. How would I do this in forms?

[Code]...

View 3 Replies

VS 2008 - Take A String Of Variables With A Common Delimiter And Break It All Back Out Into Separate Variables

Dec 11, 2011

Last year (2010) I came across a FANTASTIC command that allowed me to take a string of variables with a common delimiter and break it all back out into separate variables (possibly an array) with one statement.

[Code]...

As long as the delimiter was a unique specifiable character, this one-statement command could break it out into elements. my memory and point me in the right direction.

View 2 Replies







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