?
Solved

Please , some simple questions

Posted on 2005-03-23
11
Medium Priority
?
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
11 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
Technology Partners: 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

771 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