|
Hi there,
I'm trying to use the same variable throughout the whole project. so that i can generate score.
currently i declare as
Public score as integer
but it cannot work. Help me to solve this problem.
Thanx in Advance
|
|
|
|
|
Simple programmer wrote: Public score as integer
Where is the location that you declare your variable? Try to insert a module in your application and decalre it as:
Global score as integer
Let me know whether it is working or not.
|
|
|
|
|
Hi,
Thanx for ur reply, i declare in general declaration.
Global shows compile error so i can't use it also.
i don't understand "insert a module in your application"..
pls help me to explain.
Thanx
|
|
|
|
|
Simple programmer wrote: i don't understand "insert a module in your application"..
pls help me to explain.
In vb6 IDE, go to Project menu and choose Add module. Then click OK button when the Add module dialog box appear. The new module will include to your application and you can declare a variable that could use within your application from here.
|
|
|
|
|
Thank God finally it works. thanks a lot. once i add the module it can work ready.
Thanks Again
|
|
|
|
|
You are welcome
|
|
|
|
|
If u r using VB.NET please go to menu project and creat new item call Modould and write variabl u 1 do declare
................
|
|
|
|
|
Try "Public Shared score As Integer", it should work.
-- modified at 14:08 Thursday 6th July, 2006
|
|
|
|
|
Hi,
Is there a way we can access/extract the image information from an image processing software so that we can modify the image in our vb.net project, for example apply edge detection etc?
|
|
|
|
|
Accurately?? Only if the other application saves the image to a file that your application then loads. Getting the image directly from the other application is not possible unless the other app exposes some kind of API to do it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Then is there a way to make the 'another program' to save as default in a location where my application loads from? Can you give me an example of the file which my application loads from?
|
|
|
|
|
szevy_suez wrote: Then is there a way to make the 'another program' to save as default in a location where my application loads from
Again, this is entirely dependant on the "other program"!! If it doesn't expose any kind of API to do this, you're project is over with before you even start. There is no standard interface for this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'm sorry, but I am not sure what is an API, I tried google for it, and had a slight idea what is that, but I still dunno how to check the program's API. The program I wish to access is a software built under GNOME desktop environment. Does that help in what I intend to do?
|
|
|
|
|
API stands for Application Programming Interface. It's a set of classes/functions that your code can call to interact with with application, operating system, or hardware you want. For example, Microsoft Word exposes a COM type library that outside applications can use to manipulate Word documents.
You'll have to contact the manufacturer of the application your using to see if they supply an SDK (Software Development Kit) or API library to do what you want.
szevy_suez wrote: The program I wish to access is a software built under GNOME desktop environment
If you're talking about a Linux environment, then you're pretty much on your own. CP is dedicated to Microsoft's environments and developer tools, but does have people that support other environments, but there are no discussion boards dedicated to them.
Does this help your cause?? No, it doesn't have any bearing on your problem at all. You still face the exact same problems.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Some friends here oredi taught me how to open a program from a vb project. But is it possible to make the opened program located in a box in the vb project interface?
|
|
|
|
|
szevy_suez wrote: But is it possible to make the opened program located in a box
What do you mean by open program locate in a box?
|
|
|
|
|
Erm, it's like defining a border/frame in the interface where the program called will be opened sitted in the border/frame
|
|
|
|
|
Thank you very much for your respond. But I still can't figure out about your meaning relate to your question. If possible, please try draw a picture of what you want and send e-mail as an attachment file to my e-mail address: roathkanel@yahoo.com
|
|
|
|
|
No, it isn't. You can't make another application be a child window, or control, of your app.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello Friends,
I have been working on ASP.NET for the last 2 and half years. The
bad part of my experience is I have been working alone on all of the
projects and there was no peer around who knows .NET or OOP. So where
ever I go I just get to implement the ones I know or udnerstand. In all
of the projects I never implemented any of the OOP techiniques at all
but just a water fall approach like a classic ASP programming. Except
calling a connection string web.config file and put that in a DL and
BL to call stored proc and put the results in a Datasets or datareaders
as needed. Other than this my mind has no experience on how to take
full advantage of OOP. So I am just looking for a few pages of document
that explains a small project with just 2,3 database table objects and
how to design the components in OOP in .NET and catogorize the
components with the application of Abstraction, Inheritance,
Polymorphism, encapsulation, interfaces(when and why to create them)
and also the remaining things if I have forgotten any thing to mention
here.
Some one could help me with finding a resource like that. In a single
sentence I am confident enough to build web applications using ASP.NET
1.x/2.0 but feel handicapped in using and implementing OOP paradigm in
the application I work on. My objective is once the database folks are
done with database designing job and once its I have every thing ready
from the database I should be able to sit and design components looking
at the datamodel and design the components in .NET using OOP apradigm.
Thats my objective is. How and where do I get this kind of
understanding. I am not looking to happen this over night but a
starting point about how I need to start thinking or working from and
how?
Any help is greatly appriciated,
Thanks in advance,
-L
|
|
|
|
|
Pick up just about any book on VB.NET and you'll find what you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I used to have the same problem, except in windows applications. I would do ALL of my development in Visual Basic 6.0 because that was how i was used to think. Eventually I forced myself to develop an entire application .NET and it did wonders for me. BAsically my advice would be to make sure you understand primarily what all the OOP components are: classes, interfaces, inheritence, overloading etc. and before you start writing your classes, draw a basic diagram of your class structure. Work off of this and then at some point you'll realize your original construct could be done much more efficiently. This is when you refactor all of your code and redesign your object structure. Keep repeating this and you'll find that you gain a better and better understanding of when to use OOP and how. Of course, don't do this for a really big / corporate application, but more as a hobby thing.
Regards,
Tristan Jones
|
|
|
|
|
Hi all,
I am working with some CSV files
basicly the workflow is
CSV->datatable->datasource-> bindingsource -> display as data grid view
I have two such bindingsource
one of users by department
one of users by bill
what i would like to do is run through a loop so that any new users that show up on the bill are put into the datagrid view with ??? as there department ( so i can fill it in later)
( i later use teh department to break the bill up into amount by department)
I have the Loop down i just am not sure of the command to add a new row to the binding source
Any pointers you could give me would be awsome
code
************************************************************************
Public Sub addusers()
Dim userRowIndex As Integer
Dim name As String
For Each invoiceRow As DataRowView In Me.invoicebindingsource
userRowIndex = Me.userbindingsource.Find("Name", invoiceRow("Name"))
name = invoiceRow("name")
If userRowIndex <> -1 AndAlso Me.userbindingsource(userRowIndex)("Name") = name Then
Else
CType(userbindingsource, DataRowView)
End If
Next invoiceRow
End Sub
|
|
|
|
|
Im on the right path now but still having some trouble
It still wont do it automaticly loops through once then quits
Dim userRowIndex As Integer
'Dim currentRow As DataRowView = DirectCast(Me.userbindingsource.Current, DataRowView)
Dim newRow As DataRowView = DirectCast(userbindingsource.AddNew(), DataRowView)
Dim name As String
For Each invoiceRow As DataRowView In Me.invoicebindingsource
userRowIndex = Me.userbindingsource.Find("Name", invoiceRow("Name"))
name = invoiceRow("name")
If userRowIndex <> -1 AndAlso Me.userbindingsource(userRowIndex)("Name") = name Then
MessageBox.Show(invoiceRow("name") & " already exists")
Else
newRow("Name") = name
newRow("Department") = "???"
End If
Next invoiceRow
|
|
|
|
|
If I correctly understand what you are trying to do, this should work for you:
For Each userRow As DataRowView in Me.userbindingsource
Dim name as String = userRow.Item("name")
If Me.invoicebindingsource.Find("name",name) = -1 Then
Me.invoicebindingsource.AddNew
Dim newRecord as DataRowView = CType(me.invoicebindingsource.Current, DataRowView)
newRecord.Item("name") = name
newRecord.Item("department") = "???"
Me.invoicebindingsource.EndEdit
Else
msgbox(name & "already exists")
End If
Next
This will iterate through the users and check for a name match in every record of the invoice table. If a match is found, it shows the message box; if not, it creates a new record and sets the name and dept fields. Hope this helps.
|
|
|
|