Why Does Popping From One Stack Actually Pop From Multiple Separate Stacks

Aug 18, 2009

I have tried to simplify and annotate the code which is giving me a headache below. It demonstrates my problem. Simply put, I have two separate stacks and I am trying to pop from one stack. For some reason, when you pop one of the stacks, it actually seems to pop the other one as well?! Is this by design and if so, why and how should I work around it?

Public Class Form1
Public _stackMaster As New Stack
Public _stackCopy As New Stack
Public _strPopped As String

[code].....

View 4 Replies


ADVERTISEMENT

User Popping Up Multiple Forms (IM's)?

Jan 5, 2012

I'm working on a client using instant messages. I don't want the same user popping up multiple forms (IM's).Need 1 user in it's own form, and a new user to popup a seperate form.

Public Function createIMWindow(ByVal strUser As String, ByVal strMsg As String)
If frm_IM.txtWho.Text = strUser Then
Dim myFont As New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Point)
frm_IM.Text = strUser & " - Instant Message"
frm_IM.RichTextBox1.SelectionStart = Len(frm_IM.RichTextBox1.Text)

[Code]...

View 3 Replies

How To Check Stacks If Already Empty

Oct 22, 2008

How to test the stacks if it is already empty? I tried Stacks.IsEmpty but unfortunately I have an error says:
IsEmpty is not declared..
Is there any way to test if the stack is empty? When I'm typing (after dot) there is no IsEmpty properties of the stack.

View 1 Replies

How To Push Objects Onto Stacks

Apr 19, 2012

sub main()
dim menuhistory as stack(of menu)
dim currentmenu as menu
dim apple as new menu("fruit")

[code]....

I'm trying to create a stack of menus so I can navigate forward and back between different menus, however when I get down the push line to push my menu onto the stack I get the following error:"NullReferenceException was unhandled: Object reference not set to an instance of an object.". I'm unsure what the problem is as I am trying to push an object onto my stack, a menu object. The same error occurs even if I change the object I am trying to push directly to apple as well.

View 2 Replies

Keeping Multiple Form Instances Separate?

Sep 16, 2009

When I create more than one instance of the same form and I call a method on any of these instances, the code only fires on the most recently created instance. Even when I click a button on that form, it executes on the other form. How can I call these and keep them as distinct objects?

For example: if I build Form1 with a public method called ChangeMyColor and a button to call that method. Then in the main app I set MyForm1 = New Form1
and MyForm2 = New Form1, then call MyForm1.ChangeMyColor, the color changes on the second instance. Even if I click that button on the first instance, the color still changes on the second.

View 8 Replies

Preventing JIT Debugger From Popping Up

Nov 15, 2011

I have a program, I have published it, and I have been actually using it in my PC. Whenever it encounters an error, the JIT debugger comes out. How do I prevent it from popping up using try...catch blocks, or is there any other ways or code on how to do this?

View 3 Replies

Script Alert Not Popping Up

Jul 26, 2011

When clicking a hyperlink it goes to the booking page. On page load of the booking page I have this[code]...

View 1 Replies

VB Console App With The Window Not Popping Up?

Jul 10, 2009

I have a VB .NET 2003 application that runs on the console. When the application runs, the console window pops up which isn't always necessary. Does anyone know of a way to prevent that console window from popping up, but still continue to run? I was thinking of something along these lines:

[Code]...

View 4 Replies

Inheritance And Variety Of Data Structures Including Queues, Lists, Arrays, Or Stacks In A Windows Forms Application

Jun 27, 2012

I'd like to give a homework assignment to a person learning VB.NET. I'd like it to use basic inheritance and a variety of data structures including queues, lists, arrays, or stacks in a windows forms application. I was thinking of a pizza-ordering application. This would allow them to utilize some basic inheritance and practice using .NET UI elements.

View 2 Replies

Save Dialog Popping Under Active Windows?

Jun 25, 2010

When I call the save dialog object to prompt the user for a new file name, sometimes it does not appear as the active window, it is occasionally popping under all the open windows, and you have to minimize all of them back to the desktop to find it. What sort of problem would cause this, and is there a way to force it to the front?

View 10 Replies

Suppress Message Box From Popping Up During Unit Testing

Oct 5, 2011

Was wondering how you do this?As it's very annoying to click "ok" everytime a message box pops up.

View 2 Replies

VS 2008 Save Dialog Popping Under Other Windows?

Apr 30, 2012

I have a simple program that runs in the background and when the user presses a certain key will take a printscreen and pop up a save file dialog to save an image. But sometimes the save dialog is not appearing because it loads buried under other pre-existing windows, which have to be minimized in order to find it. Is there any way to force this dialog to be on top?

View 11 Replies

VS 2008 What Should Turn Off To Make Them Stop Popping On Debugging

Jul 6, 2009

I have a small problem, When i Start Debugging my program a lot of windows popping up such as: Watch 1 - 4, Memory 1 - 4,Autos And Registers. What should I turn off to make them stop popping on debugging?

View 4 Replies

String Manipulation - Separate Three Fields Of The Phone Number And Display In Three Separate Text Boxes?

Feb 23, 2012

I created a telephone number form where the user enters the telephone number in a text box as (nnn) nnn-nnnn. The first 3 digits in parenthesis are the ISD code, the next three are the area code and the last four are the local number. I need to separate out these three fields of the phone number and display in three separate text boxes labeled appropriately. Now, suppose the user enters the phone number in a text box as a continuous string of 10 digits, where the first three represent the ISD code, the next three represent the area code and the last four represent the local number. I'm lost as how to change this string into the form (nnn) nnn-nnnn. This is what I have

[code]...

View 3 Replies

Create Separate Object Instances For New Objects In Separate TabPages?

Sep 17, 2010

I have a TabControl object on my form with many tabs created in code (TabPages) and my problem is that the same objects that are in the initial TabPage needs to be in the other TabPages created in code, I have this done in code when the user clicks the 'New Tab' menu option, however the same code is used for any new tabs created. The problem created here is that I have an event against one of the objects that appear in the other TabPages, but because the same code is used to create any new tab pages, the event will only work on the newest tab page, if that makes sense? By the way these objects that appear on the other TabPages are properties at the top so events can be handled against them in the respective subroutine.

[Code]...

View 5 Replies

Possible To Have Separate Combo Boxes That Will Give Separate ID Values But Using Same Table?

Apr 30, 2010

I'll get straight to my problem - I'm currently coding in Visual Studio.I have a table (countries) with the columns ID | Name. The table is filled with around 28 records.I also have a form with 4 combo boxes (set up as 1,2,3 & 4) that I want the user to select. These combo boxes will display the names from the table countries. I then want to use the selected names in the combo boxes to Insert into their corresponding ID into another table. For example England would have the ID 1, USA the ID 2 etc.So, is it possible to have separate combo boxes that will give separate ID values but using the same table? At the moment I can't seem to find a solution.Eventually the form will have more than 4 combo boxes so I don't want to use separate bindingsources for each combo box.

View 5 Replies

Multi-threading Forms - Open A Separate Form As A Separate UI Thread From The Start Up Form

Oct 27, 2011

I have a few forms that have a lot of really intensive updating along with a great deal of user interface (text boxes, button clicking etc) Is it possible to open a separate form as a separate UI thread from the start up form that called it to "show" or open or whatever the new method might be?

View 6 Replies

C# - Stack Vs Heap In .NET

Oct 13, 2009

In your actual programming experience, how did this knowledge of STACK and HEAP actually rescue you in real life? Any story from the trenches? Or is this concept good for filling up programming books and good for theory?

View 6 Replies

Get A Stack Overflow?

Mar 10, 2010

What I want to know is that in VB.net is it possible to get a stack overflow, and if so how is it caused. What I mean is, what sort of written code would cause a stack to overflow.

View 2 Replies

How To Reverse A Stack

Apr 21, 2011

I need to write a VB.NET code to reverse the given characters using a stack.Input: 'S','T','A','C','K' So far I have input the letters, but I don't know how to get the console to reverse it. I'm a beginner to programming so please excuse my ignorance.

Module Module1
Sub Main()
Dim StackObject As New Stack

[code].....

View 4 Replies

.Net Stack Collection Efficiency?

Apr 15, 2009

I've started using .Net's stack collection. The basic features I guess are the "pop" and "push", where you add or take off the top element of the stack (if you are referencing other elements in the stack then another collection type is probably better).[URL]..it appears that the Stack collection (like other collections) is basically an array with some window dressing (so you actually can see other elements). As far as I can tell, "popping" and "pushing" is changing the first element of the array. Shouldn't instead the final element be the "top" of the stack and be the one that is changed? Otherwise the program has to reindex all the other elements in the array every time a pop or push is made. This seems very inefficient. But this is what Microsoft's description appears to be saying what is happening.

View 10 Replies

2005 How To Log The Stack Trace

Jun 22, 2009

My problem is that i need log the stack call. I know that i can put a breakpoint in code and choose the debug menu option "call stack", But that is not a solution for me, because i need all the methods called by the application, not only the last until the breakpoint.

View 3 Replies

Bind Textboxes To A Stack?

Apr 14, 2009

I just started programming in VB.NET 2008 with the Express edition and have been having a blast so far. I thought a fun program to try and make would be an infix to postfix program.

I have five text boxes off to the side of my program that shows what is on the stack as you iterate through the equation. I'm wondering if it's possible to make these textboxes set to display what is at a certain index of a stack.

For example, if I pushed a "(" onto the stack, I would like the top box of my textboxes to update and show a "(". When something else is pushed onto the stack, say a "/", I would like the "(" to be displayed in the second box down, and the "/" to be displayed in the top box now.

View 1 Replies

Call Stack Error?

May 11, 2010

I did alot of work then I suddenly get this error message

View 2 Replies

Can't Get Stack Trace From OjbectDisposedException

Jan 7, 2009

We have this funky little ObjectDisposedException happening now and again. But only on production machines, of course ... can't recreate the issue on my dev unit. So I trotted on out to the Microsoft site to see what members of this exception I could use to figure out what's going on. Microsoft says that one of the members is StackTrace. I double and triple checked that I'm looking at .Net 1.1 information as I'm pretty sure that's what I'm using (how can I check that?). Here's the page I found - [URL]

So I go back to my program to write something useful to the event log so I can figure out what's going on. And when I look at the members of the ObjectDisposedException available to me I only see the following: GetBaseException, GetType, InnerException, Message, ObjectName, ToString.

what happened to my StackTrace member? I sure could use it if I could figure out how to get to it.

View 6 Replies

Get Stack To Be Accessible From Operators

Oct 23, 2010

As a learning experience I decided to try and implement the Shunting Yard Algorithm(string calculator) using OOP. It was successful for as far as I took it, but it had one flaw. In order to get the stack to be accessible from the operators I had to declare it as shared, which meant that all versions of the calculator shared one stack. This very short piece of code illustrates what I came up with and the "flaw". [code] How can I maintain the functionality of anOP.add1 without declaring "something" as shared?

View 9 Replies

How To Debug Stack Overflow

Oct 31, 2010

this exception gets raised on a standard dim command???

Public Sub Life(ByVal AnyEvent As Object) Dim myNewLife As New Life Dim Happiness As New Collection Happiness.Add(AnyEvent) myNewLife.Experience(Happiness) End Sub

[code].....

View 2 Replies

Put Two Dimensional Array Into A Stack ?

Oct 24, 2011

I want to put a two dimensional array into a stack and then check the stack to see if it contains the first dimension of the array. Is there any way to override the contains function to do this.

Example:

Dim MyStack as stack

Dim sItems(0,2) as string

sItems(0,0)="Error 1"[codee].....

View 7 Replies

Stuck With An Odd Stack Overflow?

Oct 27, 2009

I'm writing this program in Visual Basic .NET to organize different fields of data, and I'm using profile slots through application settings to store the data for users. But, I ran into a stack overflow error in my SlotSelect.vb class. My best plausible guess for why this happens is that I'm using the wrong kind of variable container in the below sauce code, but my dilemma is that I don't know what specifically is going wrong.The code that the vshost is saying is the cause for the overflow was written from some code that I looked up on MSDN and other places for referring to objects in other classes, and I tried using other variants of it to see if it was any different. So far, nothing has worked, and it doesn't stop the error while compiling, much less in the code markup--it only catches it when it starts the application in debug after it finishes building

View 7 Replies

Undo The Stack Size?

Oct 2, 2010

I'm implementing multi-level undo/redo via a pair of stacks. This works well, but I'd like to limit the number of undo actions (actually objects representing the state of the application) . Once the limit of actions in the stack has been reached, I want to keep adding actions to the stack, but get rid of the oldest (bottom) items as I go.

View 3 Replies







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