473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Form variable

In my form I have several buttons that use the same string value. So I would
like to assign a constant that is global for the form. What's the best way
to do this? In which section do I place this constant code?
Thanks,
john
Jun 13 '07 #1
2 1331
Declare the constant at the top of the form, in the declarations section.
That will make it a module-level constant. I usually prefix my module level
variables and constants with an "m" to differentiate them from local ones.
Thus, I would do something like:

Const mconMyString = "Some string"

Neil

"John" <jo@hn.comwrote in message news:f4**********@textnews.wanadoo.nl...
In my form I have several buttons that use the same string value. So I
would like to assign a constant that is global for the form. What's the
best way to do this? In which section do I place this constant code?
Thanks,
john

Jun 13 '07 #2
Thank you.
john

"Neil" <no****@nospam.netschreef in bericht
news:Rg******************@newssvr14.news.prodigy.n et...
Declare the constant at the top of the form, in the declarations section.
That will make it a module-level constant. I usually prefix my module
level variables and constants with an "m" to differentiate them from local
ones. Thus, I would do something like:

Const mconMyString = "Some string"

Neil

"John" <jo@hn.comwrote in message
news:f4**********@textnews.wanadoo.nl...
>In my form I have several buttons that use the same string value. So I
would like to assign a constant that is global for the form. What's the
best way to do this? In which section do I place this constant code?
Thanks,
john


Jun 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Newbie | last post by:
OK, this may be impossible since I'm using 3rd party shopping cart ASP software, but I've been able to finagle a lot of other stuff I thought wouldn't work, so here we go: I'm using a form in...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
12
by: (Pete Cresswell) | last post by:
I know I can open many instances of a given form, but I've never done it. Now I'm analyzing an application where that seems like just the ticket: Many investment funds, *lots* of data points for...
21
by: Just Me | last post by:
I've tried in a few places using a variable name Form and it appears to be OK. For example: Public Shared Sub WritePositionsInRegistry(ByVal Form As Form, ByVal SubkeyName As String) Is it OK...
6
by: Leszek | last post by:
Hi. I wrote a script: function zmiana(ile){ while(document.getElementById('accomp').childNodes.length>1){ ostatni=document.getElementById('document.dane.accomp').lastChild;...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
3
by: hermand | last post by:
I've got an online job application I am building using ASP/VBScript. The application consists of one ASP document which has three separate states. States: 1. Form Display 2. Form Review...
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
12
by: Rob | last post by:
Let's say you open Form1 that contains TabControl1 There are several tabs on TabControl1 Now you open a new Form2 that contains a User Control How can you determine the Selected tab in Form1...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.