Code Doesn't Go Where It's Supposed To?
Mar 2, 2010
I have a VB.Net project that I haven't worked on in awhile. I got into this morning and started to run it. I got some errors so I decided to step thru the code. I enter the Page_Load event of a Form module and execute a function call and it takes me to a "End Function" statement. Totally bypasses the function that was called. I continued to step thru it and it just took me randomly thru code. No order whatsoever. I believe I've had this happen before but don't recall how I fixed it.
View 5 Replies
ADVERTISEMENT
Jan 28, 2011
So, I'm making my program which let's people auto-update other programs. Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "UpdateFiles"
Label1.Text = "Finding updates..."'To do: Find all files in the folder, and let em update one at a time. Write names of Plugins to label2.text ProgressBar1.Maximum = 10000
[Code]...
View 8 Replies
Jun 7, 2011
I have a method where I am making a trial period. When the date has exceded its trialperiod the program will not close.
The code looks like this:
Public Sub DemoRestrict()
If My.Settings.dteStartDate = Nothing Then
My.Settings.dteStartDate = Now
[CODE]...
Why does the form not close? is just runs to the next method in the load sequence
View 3 Replies
Jun 25, 2012
I'm having lots of trouble understanding how repeaters are supposed to work and how I'm supposed to use them. Basically, I have a label, a set of image buttons, and a div within a repeater. When you click on the button, I want to populate the div that was created with these repeaters (so a different div for each iteration of the repeater).[code]I can't get the repeater to iterate. It's only firing off once and then stops. I can't get a label with the repeater data source's Subject (a field in my database) to appear.
View 1 Replies
Jan 17, 2012
I am making a program, but I need to make sure a file is at a certain place on a computer other then my own. How do I do this?
View 5 Replies
Feb 1, 2011
Using 2 objects of the same type, I'm trying to implement < and >, but I can't seem to find any authoritative source on what to do with either or both being Nothing. In other words what the accepted practice or MSDN suggestions are.[code]Accessors is my canonical method for centralizing an enumeration of the properties (all are decimal)return false for both if either is Nothing?I found a comment, but can't seem to verify or validate it that A null object is always less than a non-null object..
View 2 Replies
Aug 25, 2008
I was playing around with designing a custom interface for a test application and I am using a custom image for a close button. I am using the FlatStyle properties to define it's look'n'feel. I've set the border to 0 but when the application loses focus, the border of the button shows up.I have tried to force the property to go 0 again when the application's "LostFocus" event is captured but doesn't work.I am also using a "rollover" method using MouseHover and MouseLeave events to change the image of the button.Using Visual Basic 2008 Express Edition.
View 1 Replies
Apr 3, 2012
My code seems to behave a way I don't understand. Sometimes it returns null as expected and sometimes it returns a value when its supposed to be null. How can someone explain this? Here is the code that selects from access and displays the result in a messagebox:
cmd5.Connection = cnn
cmd5.CommandText = "SELECT receipt_num " & _
"FROM brought_coffee, farmer where crop_year= " & yr & " and " & _
"brought_date=#" & dtt & "# and farmer_centre='" & ctr & _
[code]....
View 1 Replies
Jun 21, 2011
I'm attempting to create an app which uses a vendor-supplied Web Service. They provided sample code to show how to work with the Web Service, but all the code is in C#.. not a huge deal.I opened one of their demo projects and it compiles fine, works perfectly.
So, I open up MY project, drop in the converted code and... wait for it... ERROR!Here is the working C# code that IS working:
C#
private void DoSomethingWithTheAlarm(G4T.enAlarmAction action) { XML_AlarmClearRequest[] ClearRequest = new XML_AlarmClearRequest[lstAlarms.SelectedItems.Count]; int idx = 0; foreach (ListViewItem lvItem in lstAlarms.SelectedItems) { ClearRequest[idx] = new XML_AlarmClearRequest();
[code]....
View 15 Replies
Sep 14, 2010
I have made some changes in my code but when i do debug it doesn't show the changes.For example: In my code i create a simple text file in "C" drive.I have change the path to the desktop and when i do debug it still create it in the "C" drive.
View 6 Replies
Jan 19, 2012
I'm on Windows Vista Home Premium, using Visual Express 2010, working on a visual basic program.
View 2 Replies
Jan 4, 2012
Sometimes when you click view code on an item, it doesn't always automatically add in the private sub, why is this? How can I make it so it does? I dislike having to go on events every time =[
View 4 Replies
Sep 16, 2011
I am trying to learn how to use the modulus operator.this excersise is a change calculator and is supposed to calculate the number of dollars , qtrs, dimes, nickels and pennies from the change that is calculated.
in the form if i put a value in for owed = 30.00 and paid 34.25 my dollars returned = 4 and that is correct but the number of qtrs = 0 and should be 1. I am not sure how to correctly use this - any assistance you can provide is great - this is purely educational
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim owed As Decimal
Dim paid As Decimal
Dim change As Decimal
[Code]...
View 8 Replies
Oct 22, 2009
creating an internet filter that is supposed to interface with web browsers, eg. Explorer, Chrome (not a web browser I made) and then block specific websites on the browser. I'm kind of lost on where I need to start with the interface. Could someone please just point me in the direction I need to go for 1) the program to work with any browser 2) For blocking specific sites.
View 2 Replies
Jun 22, 2010
My question is, the SelectedItem property of the Combobox is supposed to return a integer value, is it not? Because I am getting back integers, sometimes, then the next time through I get back a String. Has anyone else had a problem like this with the Combobox?
View 4 Replies
Mar 22, 2011
Basically we ran into where, for whatever reason, we had to put some 3rd party dll in the GAC for it to work correctly. (The assemblies loaded, but had weird behavior and trouble finding types in the loaded assemblies. The app itself is a add in to another 3rd party program, so it must be something about how its being loaded.) So I tried to write some quick code to handle this without having to manually do this on each machine it was needed on. This is basically what the code boils down to:
Dim X As New System.EnterpriseServices.Internal.Publish
X.GacInstall(name)
Where name is the filename of the dll. This runs without error. It even add the assembly to the GAC. However, the application still experiences the same issue until you manually add the assembly in .Net Configuration window.
View 1 Replies
Oct 9, 2011
I am having a problem with visual studios 2010. I am creating ASP.net pages, but when I test/debug my code, the code-behind files runs the same code that was run the first time it was debuged this session. Meaning, to test new code-lines, I have to restart Visual Studio altogether?
View 1 Replies
Jun 23, 2010
Assume an application uses the Dim SalesArray(1 to 10) As Integer instruction to declare an array named SalesArray. The array contains 10 sales amounts. When the user clicks the DisplayAverage button on the form, he or she should calculate and display the average sales in currency format. The code for the DisplayAverage button doesn't work. Fix it.
[code]...
View 2 Replies
Jul 6, 2011
I used site to convert from C# to VB but converted code doesn't work. Can some one to convert that code to VB 2008.
private void TreeViewItem_Selected(object sender, RoutedEventArgs e)
{
ExpandToItem(sender as TreeViewItem);
}
void ExpandToItem(TreeViewItem i)
[Code]...
View 8 Replies
Oct 22, 2009
Between testing sessions on my windows service, I'm changing code (little tweaks here and there). For more detailed debugging, I've had the application send messages to a text file everytime it does something (executes a new procedure, catches an exception, etc).
I've been doing this for a while, but ever since yesterday, it appeared that the new code wasn't being used. To test this, I changed the name and location of the log file that the service would use, and re-installed it shortly after a new successful build. As it turns out, the service is writing only 1 message (about a timer being started - which is only supposed to happen after it's logged the start of the service) to the old text file. It looks to me like my service isn't using the new code in my Service1.vb file, Like the old code has been cached or something, and the service is installing from that.
View 2 Replies
Nov 8, 2010
Can anyone tell me what is wrong with this code? It looks OK to me but the GetImage function returns the same image irrespective of the filename passed to it (the one corresponding with Id=2 which is the second one found) [code]
View 3 Replies
Jun 23, 2010
Assume an application uses the Dim SalesArray(1 to 10) As Integer instruction to declare anarray named SalesArray. The array contains 10 sales amounts. When the user clicks the DisplayAverage button on the form, he or she should calculate and display the average sales in currency format. The code for the DisplayAverage button doesn't work. Fix it.
Sub DisplayAverage_Click( )
Dim X As Integer, Total As Integer, Average As Single
If X = 0 to 10
[code].....
View 1 Replies
Sep 20, 2009
I'm trying to get my head around this issue, on a few of my functions i get a warning " 'functionDealWithHiddenFields' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."Example function:
vb.net
Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer, ByVal X As Integer)
[code].....
View 6 Replies
Aug 18, 2010
Usually when I get an exception, the code line that creates it is marked yellow etc.. However now i only get a System.NullReferenceException as a line in the Immidiate window;
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Is this due to some setting, or why don't I get any better indication?
View 9 Replies
Jul 7, 2011
The code I have is meant to be used during possible rapid mouse movement by the user. It is supposed to get the current location (works), move to specified location (works), mouse down(works), mouse up (works), then return the mouse to the old position.I added the delay because it seemed that it was having trouble registering the click if done too quickly.
The problem I am having is that if the user is moving their mouse during the time the code is activated, their movement can throw the location of the mouse down or mouse up events off even with the added check routine I added.
'Get current mouse position
Dim MousePosX As Integer = Windows.Forms.Cursor.Position.X
Dim MousePosY As Integer = Windows.Forms.Cursor.Position.Y
Q = True
[code]....
View 3 Replies
May 11, 2010
I have a stored procedure that keeps timing out even though I have set the connection timeout set to 10000. The code that runs the stored procedure is this...
ADFConn1 = New System.Data.SqlClient.SqlConnection("Data Source=STPISSQ01ADF;Initial Catalog=ADF;User Id=ADFXXXXX;Password=XXXXXX;Persist Security Info=True;connect timeout=10000;packet size=4096")
[code].....
View 4 Replies
Nov 8, 2011
HTML
Public Partial Class WebForm1
Inherits System.Web.UI.Page
Public num1 As Double[code]...
This is a part of a calculator code. When you press the button "BtnAdd" the text in TxtRes is held by the global variable "num1" and the operation number (whether add or subtract) by "oper". My problem is : OUTPUT 1: prints num1 = 25 (for example)While OUTPUT 2: prints num1=0
Why is this happening ? Isn't the value of num1 supposed to be equal everywhere in the form at a given moment ?
View 1 Replies
Jun 30, 2010
I am writing a GUI application to run on a touchscreen device using VB.NET and WPF--it must be full screen at all times, like a kiosk app; the window must not be able to resize or move in any way. The window contains a ListBox that users can currently scroll through by dragging across the list. The problem I'm seeing is that when the user drags across the list, the whole window moves a bit, exposing the desktop underneath, then springs back into place once the user stops dragging. I have not been able to figure out how to keep the window stationary while still allowing users to drag across the ListBox to view all list items. Here is a somewhat simplified version of my code:
[Code]...
View 1 Replies
Feb 26, 2009
I have an application that has a timer. Every hour, the application will see what time it is. If it is after 5 P.M., then the application will shut the computer off. (For power saving purposes)I have a messagebox pop up warning the user. I want the user to be able to hit "Cancel" on a dialog box if he/she is still working on the computer and reset the timer to ask again in about an hour. If the user isn't there to select a button on the messagebox, I want the computer to turn itself off. But I can't get the code to skip the dialog box after so many seconds. [Code]
View 12 Replies
Nov 23, 2011
[URL]
I know the error and why. I am just curious. For some projects this show up as warning while for others this doesn't show up at all.
How do I set up so that the warning show up?
View 1 Replies