Routine Unexpectedly Changing Values?
Feb 24, 2009
I'm writing a program to help me understand 3d points and how computers manipulate them to 2d. Every time I run the conversion routine in my program the value I passed to it get's manipulated even though I use the ByVal key word. Here is the code in process order , tell me if I missed something here ?
[Code]...
There is a status box for me to check one of the values :> This is the flow of what I have put together so far. The problem is once I run the program everytime I press the up key to make a call to the GetPoints method the value in MyPoint is changed to reflect the forumula in the getpoints method. I explicitly used ByVal in my variables on the method call so the values in the variable would not be manipulated. I've changed it many times but I can't seem to get the method to run where it does the conversion without manipulating the values in MyPoint. I've done similar things in visual basic .net 2003 , Now I am using the visual basic .net 2008 express edition. I don't if there is a difference in the two or some unknown bug.
View 1 Replies
ADVERTISEMENT
Sep 2, 2010
I have an Enum file, as shown in first code block. Though it's first time I use an enum file, so maybe it's not correct to use it like this.. My purpose is just to be able to reference a global parameter from anywhere, so I can just type DataInterval.M1, and it will be treated as an integer... or.. will it not ? urther I have a property in my DataSeries class, of type DataInterval. And in this class I also have a bunch of methods Get/Set etc. to do different work on the dataseries (Inherits List(Of BarData)). roblem: The interval property keeps changing unexpectedly every time the GetNextCloseTime function is called.
''' <summary>
''' "Time Frame" of data series
''' </summary>
[code].....
View 5 Replies
Oct 22, 2011
This is kind of a brain twister. First, what it involves. I'm writing an application that is working with values sent to and received from an 8 bit micro-controller. There are 8 bits of specified values. Here they are. bit1 = 1, bit2 = 2, bit3 = 4, bit4 = 8, bit5 = 16, bit6 = 32, bit7 = 64 and bit8 = 128.I made a routine that uses 8 checkboxes to add the values for sending them to the micro-controller. That wasn't too hard. In my appp there are 8 checkboxes. Each checkbox assigns one of the specific bit values to a variable (or subtracts it when unchecked). The total of the variable is then displayed in a textbox and ready to send.Now the hard part that ed to take any number between 0 and 255 apart in values that will be a combination of the numbers (1,2,4,8,16,32,64,128) above and show each checkbox which is assigned those numbers to be checked.
View 6 Replies
Jan 24, 2012
I am using sockets to send message between computers. I send the messages alright. What I want is when the message "x0x" comes, the client must be closed within 5 minutes. Teh admin can cancel the request by sending message "-xx" as well. The routine that checks for incoming connections and accepts messages uses WHILE TRUE...END WHILE since it must always listen. Once I get a message, I need to fire a timer control or other that fires within 5 minutes. But the program cant leave the WHILE TRUE at all. If i exit it early, the timer fires and the program does get exit. How do I fire the timer or other routine while still the WHILE TRUE routine checks for incomin connections and messages?
View 5 Replies
Apr 17, 2011
is there any way to reference a particular code routine in VB.net external to the current loop/routine?Example:
If Var01 < 5
[Routine A]
Else
[Routine B]
End If
where Routine A and Routine B are code sequences at the end of the entire program -- such as outside of the current sub or class? The idea would be to reference an otherwise repetitive code.
View 4 Replies
Dec 27, 2009
I wish to read a web page that had various frames and div elements.To start with I would like to create a routine that justs lists all of those elements values and then display each element name and its value so I know what I have and how to reference it later on.I have been using the WebBrowser control and have managed to do a few basic things so far like go to a website and auto login.
View 2 Replies
Mar 3, 2009
I have a sub routine where I pull in information from a database. I want to use variables from this sub routine in another sub routine. I tried making everything public but it doesn't want to be friendly and share.
Dim strEmail as String
Public Sub readDB()
strEmail = "whatever@doohikcy.com"
[Code]....
The readDB would read the database and set the variables and do whatever it needs to do. Then when they submit the form it would e-mail the form to whatever the email address was.
View 2 Replies
Dec 2, 2011
In my datagridview, I want to be able to change the value of comboBox1 depending on what the user selects in comboBox2 I had this working correctly, however if I move onto a new line in my gridview and select a different value in the second row it changes the previous row also.In the below code the correct values are generated in the combo boxs, however when I move onto a new line in my datagridview and choose a different value from my comboBox I get this error:
"The Following exception occurred in the DataGridView System.ArgumentException: DataGridViewComboBoxCell value is not valid To replace this default dialog please handle the DataError event."
Private Sub Expenses_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TblCompanyTypeTableAdapter1.Fill(Me.Exp_testDataSet10.tblCompanyType)
[code]....
View 3 Replies
Apr 23, 2009
All variables and Arrays have been declared properly the problem Is when the user enters a new number using a scroll bar
LottoNumber = HScrollBar1.Value
Label2.Text = "Number Selected: " & LottoNumber
The out put of the variable count stays at 1 so the output stays at (Pick # 1 of 6) and doesnt increment at all and does not build the OutPut string
'IF The LottoNumber Location Value is 0 in the Array selectedLotto THEN mark it by making the Loacation Value to 1
If selectedLotto(LottoNumber) = 0 Then
[Code]....
View 3 Replies
Jan 20, 2012
I want to loop through a databale and change the values of a specific column in that datatable.eg: the database returns Request_ID, Desc, Date and Status_Ind. The Status_Ind column contains integer values. I dont want to show the integer values to the user. I want to convert that to a string value based on the integer values returned in that columns.
View 2 Replies
Jan 14, 2010
Im trying to check to see if a value of a label changes over time. however I can't seem to get it right.
dim val1 as string
dim val2 as string
private sub form1_load()
dim val1 = label1.text
end sub
[Code]...
problem is it will only check it once after ten seconds when the timer is set to 10 seconds i need to to check it every 10 seconds becuase these values display altitude, and if the server freezes the altitudes dont change. I need to make sure they are updated and not frozen.
View 3 Replies
Jan 5, 2009
My first time and first post here.I am trying to change specific registry key values (to enable fast user shutdown), but I get an error message when I try this. I will hopefully be implementing a number of the TweakUI functions, but in my own representation.
[Code]...
and I get the following error message:
"The specified RegistryKeyPermissionCheck value is invalid. Parameter name: mode"
(I've changed the Security.AccessControl options but none of them are suitable)
I've only been using VB 2008 for about 4 months now, and had no coding expereince prior to this
View 11 Replies
May 26, 2010
I have one hour format datetimepicker and other short format datetimepicker. When I select an hour from 1:00 AM to 5:00 AM want to change the current day to the day before. I tryed to - 1 day but doesn't work or maybe isn't the correct way to do it.my error says operator '-' is not defined for types 'Date' and integer
here's my
Dim hora As Date
Dim fecha As Date
hora = Me.dtpHora.Value
fecha = CStr(Me.dtpFecha.Value)
[code]....
View 2 Replies
Mar 25, 2012
I have an array of structs and each struct contains values for the checkboxes. I am trying to display the checkbox values contained within a particular struct.
MyStruct is an array of structs which has a values for the checkboxes
ChkBoxCol is the collection of check boxes for the form.
I am iterating through the collection as follows:
[Code]...
What I am noticing is that if the check boxes are checked in order (checkbox 1, 2, 3, 4...etc) the code works fine and the values are displayed correctly in the form. However, if the check boxes are not checked in order (4, 5, 7...etc) the code does not write the values of the check boxes and instead keeps them blank. I just need to display the values for the check boxes for a specific struct.
View 5 Replies
Feb 23, 2011
I am working on a way to change either the x or y value of a point and am getting an error while doing so. the code i am using to do this is the following:pts(currentNo - 2).X = pts(currentNo - 2).X - 10pts is a list of Points and currentNo is merely a count that im using to track where i am in the list. I am getting the following error
View 2 Replies
Jun 5, 2011
I have a project due tonight and suddenly 2 of my datagridviews are acting funky while the others are fine.
I have 2 tables in an sqlce db. the first is books(id, title, copyright) and the next is publisher(id, name, bookid). I'm writing a vb.net frontend to access the data.
I have data bound datagridviews for both tables. Both have their respective ID columns hidden. The publisher dgv uses a combobox cell style to display the book title in the bookid column. So far so good.
I have suddenly run into a problem where if I have clicked in a cell on the books dgv and then click a cell on another row, the title changes to the id value. The publisher dgv also updates to show the id instead of the title.
It sounds to me like there may be a problem with the booktableadapter or bookbindingsource, but I don't know where to start looking for it. I have a 3rd dgv referencing an unrelated table, and it has no problems. The code for both the working and problematic dgvs are the same (only the control names are different).
View 2 Replies
Aug 18, 2011
There are 2 subs. First one populates a DataGridView with data from a SQL table:
Dim SQLCom As SqlCommand
Dim myDA As New SqlDataAdapter
Dim myDS As DataSet = New DataSet()
[Code].....
View 4 Replies
Jan 3, 2011
I have a grid bound to a datatable. The grid has two boolean fields. What I want to happen is, when the user checks one field (or perhaps I change that field's value in code), I want to automatically uncheck the other field. I tried the following code, and it gives me the results I'm looking for, but only after the user leaves the row. I want it to happen when the user clicks on the cell.
Private Sub ComparisonGrid_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ComparisonGrid.CellValueChanged
If e.RowIndex > -1 Then
If e.ColumnIndex = Me.FirstUseColumn.Index Then
[Code]...
View 2 Replies
Mar 19, 2009
I have a web.config file on my computer.There are alot of things i need to change and add in the file. (I am actually working with my SharePoint web.config file)Can i do this with a Batch file, if so how would i do it. Or how would i do it using VB.NET or C# code? Edit: i need to create a program to alter a web.config of lets say i web.config laying on my deskop and not the actual web.config of my project
View 7 Replies
Mar 7, 2011
How to set up a Chart using the new MS Chart control. I want to be able to populate the data via SQL because the user will be able to dynamically change the values via drop downs. The format of the data will be the same (Qty, Time Period) but the Focus of that data will change. I'm honestly not sure where to start, I can draw the chart but I have no idea how to populate it with data via code so it can be changed dynamically.
VBE 2010, and I'm hitting an AccessDB
View 2 Replies
Aug 22, 2010
I have been dabbling in VB before and i played around wiht linq to sql back then but im wondering what i should go with here.I need to have a list of people.. They should all have their own id nr.
The people in the list are supposed to keep a record of values changing over time with a datetime stamp. (In my case its numbers from a test outcome of blood)You have to be able to add people and delete people. All records will be deleted too.A Chart will read information from the records and display changes over time in chart.I was thinking of doing it with linq to sql and i was kinda aiming at Creating datatables with id names from the script
Havent found a way of creating datatables from a script though..I was hoping for a solution like that.. And i was hoping id be able to search databasetable names.
View 6 Replies
Nov 22, 2010
I have a form which has a user control in it added dynamically. How can I change the values in that dynamically generated user control? All my functions are in a module and I will just call them in main form. So in module how can I find that user control and change its values? I tried writing a function in user control form. Like it has 10 txt box and I tried to pass a structure as argument in that user control form but I am unable to do so. when I tried to declare the structure outside function parameter in user control form it works well but not as function parameter..
View 6 Replies
Oct 13, 2010
I want to programatically delete some pixels that are unused in order to reduce the image size.Can anyone tell me how to reduce the size of an image file without changing the pixels values..
View 1 Replies
Apr 6, 2009
I am making my project for this semester. I am making "System monitoring Tool" so i have make a GUI and also get the all parameters but one thing missing I have tried to find from different places but not found that is the "continues line" that represents the changing values of CPU usage along time. same like "windows task manager" shows.
View 1 Replies
Sep 6, 2009
[edit]oops - stupid typo - this is resolved and explained in the next post[/edit] I've got a BINDING SOURCE - that I bind to controls - textboxes mostly. I create a row in the datatable behind this BINDING SOURCE like this.
[Code]...
View 1 Replies
Apr 26, 2011
The site is a buy/sell site and the page the code comes from is the "add product" page.
The problem is that the session("change") becomes nothing by some reason, i cant find any errors.The payment.aspx have a button that sends me back to the page with a session("change"). The reason i see the problem is that i when i try to edit something the category gets restetted to the first in the list. and when i debug i see that the session is nothing, though it should be something
Heres the code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSubmit.Click
If Not stats > 0 Then
[Code].....
View 1 Replies
Nov 2, 2010
Can you write code to tell an event not to fire? Sometimes in my applications events fire unexpectedly. I know this is a broad question, but it must have happened to others out there.
View 2 Replies
Jan 26, 2010
I am having an issue with a cookie that keeps getting deleted by the application. When you go into the application, if the cookie does not exist, it gets created. This works fine and everything in the cookie is stored correctly. When I click on a link to go to another page, once everything loads completely, the cookie gets deleted from the file system. Even stranger than that, the values from the cookie remain until the browser is closed. That is the application appears to be retaining the values even though the cookie does not exist on the local file system. The next time you enter the application, the cookie is recreated so any values stored are lost.Now, I have done some tweaking on the code to see what could be causing it. I found that I am adding the cookie to the Response object any time I make a change to the cookie. The cookie is also being added to the Response object when the page load is completed. My initial thought was that adding the cookie multiple times to the Response object could be causing the issue. I commented out the code in the page load complete event and the cookie hung around until the next postback. Then I put in some logic to keep the application from putting the cookie into the Response object more than once, and then I lost the cookie again at the same point as before.All of the code for handling cookies is in my "base page" that all pages inherit from. The page that seems to be loosing the cookie is my search page. I am including the code from both of those pages.[code]
View 1 Replies
Feb 16, 2010
I fail to build project in window7 64 bits. I am using VS 2008. Its working fine at vista 64 bits but when I compiled it at window7 64 bits, I get the following error:
C:WindowsMicrosoft.NETFrameworkv3.5Microsoft.Common.targets(1682,9): error MSB4018: The "GenerateResource" task failed unexpectedly.
C:WindowsMicrosoft.NETFrameworkv3.5Microsoft.Common.targets(1682,9): error MSB4018: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
C:WindowsMicrosoft.NETFrameworkv3.5Microsoft.Common.targets(1682,9): error MSB4018: at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) .....
View 2 Replies
May 22, 2009
I have a modal form with a single instance of the built-in .NET 2.0 tab control. The tab control has several pages, and on one of them is a combo box that isn't populated until the user activates it for the first time. When that happens, I handle the DropDown event and run a process that takes several seconds, then I add the items returned by that process to the combo box.It works fine, except right after the list portion of the combo box is dropped down, it immediately closes as if some other control took the focus. I've narrowed it down to the fact that there is a tab control on the form, and the process that retrieves items for the combo box takes more than 4 seconds. If I create a completely blank form with just the combo box, I don't see this behavior.
Needless to say, this is strange beyond belief. Any idea why the tab control would interfere with the control that currently has focus?
[Code]...
View 1 Replies