Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Please , some simple questions

Posted on 2005-03-23
11
Medium Priority
?
167 Views
Last Modified: 2010-05-02
how can i make a variable that is valid to all forms in a visual basic project?

How can i find a simple tutorials for DirectX programming?

about robotics does anyone have programs for controlling robots using matlab or anyother language?
0
Comment
Question by:Ahmedqatar
  • 4
  • 3
  • 3
10 Comments
 
LVL 23

Assisted Solution

by:gecko_au2003
gecko_au2003 earned 60 total points
ID: 13610041
Public VariableName As DataType

for example

Public intCount As Integer

go to www.google.com and search for them and also get the Direct X SDK, that will have plenty of examples.

I am not sure with regards to your last Q
0
 
LVL 13

Expert Comment

by:iHadi
ID: 13610827
To make a variable valid for all forms in VB add a module from the project menu
Declare the variable in the module as  gecko_au2003 shows

And for some examples and tutorials on DirectX you can visit the following sites
www.pscode.com

in there you'll find begginer code to advanced code
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13610891
What is the difference between declaring Public within the general declarations area of where the code is for the form or inserting it into a module ? This is on and off topic considering it might be useful for  Ahmedqatar to know this as well :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13610895
BTW - If this is ir relevant to this question then just ignore the question I asked
0
 
LVL 13

Accepted Solution

by:
iHadi earned 90 total points
ID: 13612245
When declaring a public variable in a form that means the form will be loaded and the form_load event will fire when using this variable for the first time although the form isn't visible
And when you call Form.show to show the form the load event doesn't fire because the form is already loaded

closing all other visible forms in your application must cause by default to unload all those forms form memory and your application to end but that doesn't happen if you use the public variable in the loaded but unvisible form, so it stays in memory until you unload it manualy by code

And if you unloaded the form manualy for some reason while you are running you application the variable will lose its data
0
 

Author Comment

by:Ahmedqatar
ID: 13813588
Still i am not satisfied with the ansewers i got ... still i have the same problem .. in some forms i can read the variable but in others i can't ... with the end of this week i will make my selection ...
0
 
LVL 13

Expert Comment

by:iHadi
ID: 13813816
Can you post where and how are you declaring your variables and where and how are you reading them
0
 

Author Comment

by:Ahmedqatar
ID: 13853036
I am declaring my variables in a modulus:

Public Var as Integer

But before i only write:

Dim Var as Integer ..

so in some forms i can read the variable and in others i can't ...

Any wa .. thank you for answering my question ..
0
 

Author Comment

by:Ahmedqatar
ID: 13853058
i would like to devide the 50 points on 2 persons .. how can i do it??
0
 

Author Comment

by:Ahmedqatar
ID: 13853066
thnaks .. i did it ...

see you in another question ..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question