|
You can create a static (shared in VB) property in each form class where you store the current instance of the form. In the constructor of the form you store the reference to the instance:
This of course means that you can only create a single form from each form class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Thanks for your replies, however I dont fully understand the jargon, would it be possible for you guys to send me example codes on how this can work?
Cheers
Jaidev
|
|
|
|
|
If you don't understand what shared is, you should buy a VB.NET book and work through it. Delegates are widely documented on the web, if you google any of the 'jargon' we've given you, you'll get more detailed examples than you will find in a forum post.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What ive done is created a new class (class1) in which ive stated my variable.
then ive referenced this class, but its still not working.
form3.
Dim var As New class1()
---------
If var.numberofcalls = 1 Then
dsNewRow.Item("UseCaseID") = "2"
End If
form1.
Dim var As New class1() --> seems to work
class1.
Public Class class1
Public numberofcalls = 0
End Class
Am i pointing in the right direction?
Jaidev
|
|
|
|
|
Perhaps, the problem is, you didn't make the variable 'shared'. Shared means, there's only one instance of the variable across all class instances, which means you can set it in one class, and get it in another, without having to pass an instance around. In C#, it's called 'static'. Google these terms and you should find good examples of how it works.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How do I create an ESRI shapefile for my Dundas map control
|
|
|
|
|
Don't Dundas have support forums specific for this kind of thing?
|
|
|
|
|
Hi all,
I built client server application which using tcp protocol
example code :
listener = New Sockets.TcpListener(System.Net.IPAddress.Any, PORT_NUM) ...
If im the server and I behind router, i cannot communicate with a client side only if i open a port in my router.
I wonder how all multiplayer's games work if no one needs to open any port?
Can it be the server side is a not a home computer but a real server that control many clients?
Should i need to run a thread in the server that manage all players (all players are the clients?) ?
if this the way (using a thread that always run in the server and manage all players from home computers which are the clients)
What will happened if the thread stuck or the server shutdown, this will kill all users(players).
Ill appreciate any help building multiplayer's gaming manage by server side (or any other good technology for multiplayer's games using router)
|
|
|
|
|
As the game server has to work as a server, it has to have a port open in the firewall, regardless if it's a real server or just a regular computer acting as a server.
The server will have an application running that handles the traffic from the player's computers. How you choose to use threading depends on how you communicate with the player's computers, and what else the application should do. A web server for example uses a thread pool and handles each page request in a separate thread.
---
single minded; short sighted; long gone;
|
|
|
|
|
how could an image be captured from an avi file in vb.net?
|
|
|
|
|
There is at least one article on this site that uses the DirectShow wrapper to do it in C#. you could use the DLL and call it from VB.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hello all,
I have a data grid in vb.net 2003 connected to the database
what I need is to select specific data by choosing the employeeID using comboBox
e.g: comboBox: a.srour
datagrid: view a.srour details ....
|
|
|
|
|
There are definately articles on the site for putting a combo box inside a data grid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank u Christian Graus, but what i want that the combobox outside the datagrid, it is a kind of filter.
select a value from comboBox for its details to be viewed in the datagrid
srour_costavo@hotmail.com
|
|
|
|
|
Oh, OK. That's even easier. You just handle the index changed event on the combo, and run fresh SQL to fill the grid based on the selection. The combobox lets you store a value that's associated with each string entry, so you can hide the Id you need in there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok man but the real problem is in the syntax, the concept is understood,
the help I need is syntax help would u do that
srour_costavo@hotmail.com
|
|
|
|
|
To be honest, I can't. How are you accessing your database ? What sort of database is it ? What value do you want to use to select your values ? What is your database schema ? I can't provide more direct help without all of that info, and if you can't do it, I'm wondering which bit you're stuck on ? Can you access your database at all ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
''The SQL select Command
Private Sub conn()
dt = ProfileDAO.ExecuteStrDt("SELECT [ComputerName], [Comming], [Leaving], [TotalTime], [IncludeTotalTime], [OverTime],[overtimeckh] FROM [HR].[dbo].[WorkingHours] )
DGtimeS.DataSource = dt
End Sub
' I am Accessing the db without problems
' the comboBox is also connected to db and retriving data without problems
Private Sub ttt1()
Dim FullName1 As String
Dim i As Integer
dt = ProfileDAO.ExecuteStrDt("Select EmployeeID, FirstName, fatherName, LastName from Employees order by FirstName")
Me.CmbEmployees.Items.Clear()
With CmbEmployees
For i = 0 To dt.Rows.Count - 1
FullName1 = dt.Rows(i)(1) & " " & dt.Rows(i)(2) & " " & dt.Rows(i)(3)
.Items.Add(New Mylist(FullName1, dt.Rows(i)(0)))
Next
End With
End Sub
'what i want is to connect the combo box and the data grid
'vb 2003 & sql 2000
is that possible
& if u give me ur email i may send u code of the app
|
|
|
|
|
OK, so you have the employee Id in your combobox item. Now, pull it out of there when a selection is made, and write your SQL with a where clause that uses this Id to get only the data you need, and bind it to your grid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I know that i am disturbing a lot, and i understood the concept very well but the real problem is that I DONT KNOW THE SYSNTAX to do what u are saying.
my demand is the sentax bro.
is that possible?
srour_costavo@hotmail.com
|
|
|
|
|
TWo things
1 - no way do I give out my email address
2 - I cannot give you exact syntax. Like I told you, unless I see the schema of the DB, I don't know what it is. Why can't you work out the syntax ? Is it the SQL that you have trouble with ? b/c the data access code doesn't really change.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
please move my posts to vb.net forum if this is not the vb.net forum
|
|
|
|
|
I can't insert row in excel,who can use vb.net realize!Please tell
me,If any one have time can more about poeration Excel,Thanx!
jeam
|
|
|
|
|
Microsoft have an Office toolkit you can install to control later versions of Office with .NET code. Your code will only work on machines that have office installed.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanx,but I want to know how vb.net to do it not with office toolkit?
|
|
|
|