How To Decalre Something Globally

Jul 27, 2009

I have a connection string issue, sometimes when I change servers, I run into an issue of where My.Settings.Save doesnt save the changes sometimes. I created a text file when I change my connection string to see if it is saving the right information and it is, but sometimes my settings does not reflect the changes after calling my.settings.save.

View 1 Replies


ADVERTISEMENT

Pass An Object Variable But Doesn't VB Force Decalre The Header As ByRef?

Oct 20, 2011

Why if you pass an object as byVal into a method is it then treated as if it were byRef? I know you're only passing the reference across when you pass an object variable but why doesn't VB force you to decalre the header as byRef?

View 2 Replies

Globally Declare A Class?

Jun 1, 2009

I know you can globally declare a structure so every class knows it.But I have a class named "WPNConnection", but I was wondering if you do like.Public WPN as new WPNConnection but so every class in the whole project could access it. It's just annoying having to raise events to get back to the class holding it, or finding the main class and finding it declared there.

View 2 Replies

Calling A Method From .dll Globally In C# Application

Aug 26, 2009

I am using a .dll called Kiosk in my application which is resonsible for disabling some keyboard keys. I am doing like this... using Kiosk; public static Kiosk.Kiosk KIOSK = new Kiosk.Kiosk();

[Code]...

View 2 Replies

Creating Object Instances Globally?

Nov 19, 2009

this is probably something I should know, but I'm puzzled by this.I'm trying to create some objects and being able to access and modify these globally. I tried to create a Public Module and declare a few objects in this.I am able to access these from another sub, but I get an exception error when after building and runing the process and trying to modify these object. The same thing happens if I declare the object in the Public Class Form1. For example like this:

Public Class Form1
Public appWord = New Microsoft.Office.Interop.Word.Application
Public wordDoc as Microsoft.Office.Interop.Word.Document

[code]....

View 1 Replies

Importing System.data Globally?

Jul 10, 2009

how can i import system.data.sqlclient globally?

instead of typing system.data.sqlclient in everypage.. i want is to type it once and all pages has now the namespace of the system.data.sqlclient...

View 6 Replies

Store A Value Globally (Application Level)?

Jul 10, 2009

I need to store a value globally (application level). This is part ID retreval program, procedure will return teh Max ID number thena i need to store the retreved value gloablly, so that if the user open many intance of teh same form i can use the gloabl value, to send Unique ID numbers to each form.

View 4 Replies

VS 2008 Declare Value Publicly (globally)?

Sep 15, 2009

Ok this is probably the most basic question that you ever saw. How to declare value publicly (globally).

I want to declare time = 0

And I want my timer sub to know what time equals to How can I do this?

View 3 Replies

[VB 2008 EXP] Globally Press Keys Down?

Apr 5, 2009

I am trying to make a program that outputs a series of key presses into another window. I have been trying to do this with the SendKeys but have found that it it presses the key too quickly for the other application to be affected enough to cause much output. I need a way to globally press the key down and key it up over a period of time. If I know the code for pressing a key down and up globally I'll be able to link it up with a timer and work from there assuming the key codes are the same as SendKeys.

View 3 Replies

Generating A Globally Unique ID Of 16 Char String?

Jun 18, 2009

I need to generate a globally unique ID of fixed 16-lengthThe GUID is too long for my purpose. So I wonder is there any way to convert it to a 16-length?If this is not possible, I have a program key of 8 chars, and is thinking of using the DateTime as my key.

View 4 Replies

VS 2010 Get Current Cursor State (Globally)?

Jan 28, 2012

how can I get the current cursor state (Hand or IBeam or ...etc) .. at any active window not only at my form

View 3 Replies

VS 2010 Recognize When Mouse Is Clicked Globally

Jun 27, 2010

Ok i got the mouse to click, now i need to get like a IF statement for the left and right mouse click, e.g IF Rightmouseclick then do whatever and i need a leftmouse click one aswell, i found this on another thread but it doesn't work??

[Code]...

View 8 Replies

Globally Declared Collection (List Of) Not Maintain Values Across App

Mar 10, 2012

I've been building a simple card game in VB using VB 2010 express. I've built a simple Card class, as follows:
Public Class Card
Public Property Number As Integer
Public Property Suit As String
Public Property Image As String
End Class

I setup a base deck to create the unique, individual cards, which will then be used in multi-deck games. I have a game table form where the cards will be displayed. I declared this base deck inside the game table form and built it during the form's load event:
Public Class Main_Table
Public baseDeck As List(Of Card) = New List(Of Card)
Private Sub Main_Table_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myCard As Card = New Card()
[Code] .....

Everything runs fine up until the end of Main_Table_Load. I've inspected the baseDeck values and they are correct. But when the Build_Deck_Click sub is invoked, the baseDeck collection's values become all the same, specifically it becomes composed of copies of the last card I built. I've stepped through the code and expanded baseDeck to confirm that all Cards become the same. I've tried moving the Public baseDeck As List(Of Card) = New List(Of Card) to a different module, with the same results. Since I will be using the baseDeck list through the app, I can't declare it privately inside the form_load event, as I'd have to re-create it every time I need to use it.

View 2 Replies

Declare A Variable Globally So That It Is Visible To All Projects Of A Single Solution?

May 26, 2009

In vb.net 2.0 is it possible to declare a variable globally so that it is visible to all projects of a single solution?

View 1 Replies

VS 2010 Utilizing A Class Globally - Create An Instance That Is Usable Across Forms / Modules

May 8, 2012

I have created a class (pasted below in case I did something wrong) for which I want to create an instance that is usable across forms/modules. I can create an instance of the class in a single form/module no problem via DIM User as New User but how do I go about create a public instance accessible from all parts of my program?

[Code]...

View 7 Replies

Change Font/text Size Of Every "label,button,groupbox" Ect. Globally?

Nov 26, 2011

I have a checkbox in my options form to change every every font size in the form to something like "20" when it's checked. is there a way to globally change the font size of everything when the checkboxes checkstate becomes checked.

View 9 Replies

VS 2010 Possible To Declare An Array List "globally"?

Apr 24, 2012

[Using .NET 2.0 framework] would like to declare an array list inside a global module, if possible. Like...

Module GlobalModule
Public MyArray As New ArrayList()
MyArray.Add(Label1)

[code]....

View 12 Replies







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