|
Dave Kreskowiak wrote: This is the same link the other person gave. You might want to read the other posts before you reply.
You are absolutely right. My appologies for this.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi to all,
My question is a simple one how can i access controls of Startup Form from another class. Means i want to access that instance of the form which is available in the memory, don't want to create another instance. Thanx !!!
-- AliAmjad --
|
|
|
|
|
AliAmjad wrote: how can i access controls of Startup Form from another class.
In proper OOP programming, you don't. The only class responsible for those controls would be the form class. Your other classes do not need to know about those controls, nor should they even care to update them themselves. This would tie your other class to that form so hard you would be able to use the class in any other project.
Your class should be exposing events and properties that your Form class can get to and subscribe to so the form updates it's own controls, not the other way around.
|
|
|
|
|
Thanks for the reply. But i think it's not applicable in the scenario which i am facing. What if i am using the class which is responsible for raising events in many other classes then what should i do.
I've actually created a class named InformationReceived.vb
Declared its variable in a module. Then handled this class in that module here is the code:
Module GlobleMDL
Public WithEvents infoRec As New InformationReceived
Private Sub infoRec_Information_Received(ByVal info As String) Handles infoRec.Information_Received
MsgBox(info)
End Sub
End Module
Now instead of using msgbox whatever information i am receiving for other classes i want to display it on the statup form's Textbox.
If i declare and handles this class in the startup form's class then how can other classes access the instance of this class(informationReceived.vb)
|
|
|
|
|
AliAmjad wrote: But i think it's not applicable in the scenario which i am facing.
No such thing...
AliAmjad wrote: If i declare and handles this class in the startup form's class then how can other classes access the instance of this class(informationReceived.vb)
They can't. You're going about this all wrong, and the method you've come up with won't even work. Scrap this class/Module/whatever, you don't need it.
In your property getters/setters, you put Debug.Trace statements. Trace messages are caught by any of the TraceListener classes. You create this TraceListener in your main form and it'll hear all of these message no matter where they came from. Then you can Append each message in a TextBox.
|
|
|
|
|
Dave man i am really thankful to you. Just the final question because i am learning allot here. How can i append the messages to the Textbox and where to handle the class or when am i sure that i have received the message.
I've created the instance of DefaultTraceListner in the main form. And using Trace.Writeline for receiving information from other classes.
Thanks Again...
|
|
|
|
|
AliAmjad wrote: How can i append the messages to the Textbox
It's easy. I occasionally use this quick'n'dirty class to do the same thing while I'm writing an app:
Public Class TraceLogSupport
Inherits TraceListener
Private _targetTextBox As TextBox = Nothing
Public Sub New(ByVal TextBoxControl As TextBox)
Mybase.New()
If TextBoxControl IsNot Nothing Then
_targetTextBox = TextBoxControl
Else
MyBase.Dispose()
Throw New ArgumentNullException("You must specify a TextBox control to use to show log information.")
End If
End Sub
Public Overrides Sub Write(ByVal message As String)
_targetTextBox.AppendText(message)
End Sub
Public Overrides Sub WriteLine(ByVal message As String)
Me.Write(message & Environment.NewLine)
End Sub
End Class
To use it, all you do is creat an instance of it and pass it a TextBox you want it to use to log information to. I usually just use a small form with a TextBox on it and do something like this in it's Load event:
Private _tractListener As TraceLogSupport
...
Private Sub LogForm_Load(blah, blah) Handles MyBase.Load
_traceListener = New TraceLogSupport(LogTextBox)
Trace.AutoFlush = True
Trace.Listeners.Add(_traceListener)
End Sub
That's it, except for peppering the code with Trace.Write and Trace.WriteLine statements...
|
|
|
|
|
Hurrayyyyyyyyyyyyyyyyyyyyy !!!! thanksss man thank you very very much for your support this site really rocks and helped me allot. Again thanks for your support mannnn...
|
|
|
|
|
I have a windows application project that uses several Crystal Reports. When I created these reports I connected them to an access database that had the table/column structure that I wanted, but the application itself does not use this database. It creates a DataSet that matches the structure of the design database and uses the .SetDataSource to load it into the report like this:
reportDocument1.SetDataSource(dsMyDataSet)
This has worked fine in the past. Now I've added a new report and when it is run on a machine that doesn't have the design database in the same location as it was when the Crystal Report was designed and created, it will prompt asking for Database Login information.
I've seen many other posts with similar questions, but the only ones with solutions appear to still need to tie to a different database or the developer wants to learn how to pass login information in the code. I do not have a database at all to tie to. How can I sever this connection to the database and tell the report that I will be passing my data via a dataset? OR is there some other reason why this would be happening? I've tried to find differences between the report that still works and the new one but I can't see any different settings. Are there any tricky ones I may have missed?
Any help would be appreciated.
|
|
|
|
|
Kschuler wrote: when it is run on a machine that doesn't have the design database in the same location as it was when the Crystal Report was designed and created, it will prompt asking for Database Login information
Sounds like log in credentials are different. Have you tried making sure they are the same.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I've never done anything in regards to logging in to the design database. I never setup any users or passwords nor do I require any securities since this database never holds any data. And I am not aware that it is possible to setup log in credentials on a dataset. Could you please clarify or give me an example of what you mean? I really appreciate the help.
|
|
|
|
|
I'm getting the following error and I'm pretty sure it has something to do that i moved the code to Visual Studio 2005.
Just wondering if anyone has seen it before and could help me out.
Compiler Error Message: BC32206: Indirect reference is being made to assembly ITSWeb.PageTemplates version 1.0.2827.13561, which contains 'ITSWeb.MenuControl'. This Project references a prior version of ITSWeb.PageTemplates version 1.0.2826.16005. To use 'ITSWeb.MenuControl', you must replace the reference to ITSWeb.PageTemplates with version 1.0.2827.13561 or higher.
Source Error:
Line 34: <system.runtime.compilerservices.compilerglobalscopeattribute()> _
Line 35: Public Class webusercontrols_menucontrol_ascx
Line 36: Inherits Global.ITSWeb.MenuControl
Line 37:
Line 38: Private Shared __initialized As Boolean
Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\itsweb\6130ecab\c8ceedfb\App_Web_menucontrol.ascx.8ddfe73a.iy-bw6ax.0.vb Line: 36
|
|
|
|
|
google "Compiler Error Message: BC32206" and read the first link.
I hope this helps...
You always pass failure on the way to success.
|
|
|
|
|
Thanks for the reply but i just changed the <assemby: assemblyversion("1.0*")=""> to <assemby: assemblyversion("2.0*")="">
but if anyone knows anything about what i just did and want to explain that would be nice
|
|
|
|
|
Sorry it didn't show up i changed the Assembly: Assembly Version("1.0.*") to Assembly: Assembly Version("2.0.*")
|
|
|
|
|
I just changed the Assembly Version back to 1.0 and i didn't get the error again. Anyone know what's going on?
|
|
|
|
|
Did you read the link I posted?
If you did you would have seen that the poster deleted some dll files.
So I'm guessing that something similar has happened, except in your case VS has done the work for you.
You always pass failure on the way to success.
|
|
|
|
|
Well i thought i fixed it.......so i didn't pay much attention but i read it.
Mainly because my project randomly crashed again, but i just deleted all the dll files out of the bin file.....rebuilt it then ran it and it worked.
So thanks for the post
|
|
|
|
|
You're welcome
You always pass failure on the way to success.
|
|
|
|
|
I don't know if i am at the right forum, but anyway hereis my question>
I need help by the switch /autorun in outlook and well on the syntax,
because i can not call a macro whe i use the switch, and get an error evertime i fill in a other approache.
thanks,
Peter
Peter Staal
|
|
|
|
|
You're more than likely in the wrong forum. This forum is for VB/VB.NET programming questions.
I have no idea what you're trying to say in your post. Outlook doesn't have an /autorun switch and I have no idea what you're trying to do with a macro, or how the switch relates to your macro.
|
|
|
|
|
How to Pass Value from vb.net tool or form in Crystal Report
Plz Help me
I Had complete my project in college.
My Project Title is "Transport Management System"
Include the Lorry Entry, Challan, Memo
|
|
|
|
|
|
Hello everyone,
This is my first question to codeproject members. I hope everybody will help me.
I'm doing project in VB.net 2005 in windows form.
I designed forms
created database and table in SQLServer
Now I don't know how to connect this to window form.
How to write connection string, non-execute query.
Like VB6.0 whatever type in text box, listbox it should be inserted/updated in table column field respectively.
Plzzzzzzz help me.
Thanks in advance
Ashwini
|
|
|
|
|
For using database connectivity on .Net platform, Ado.Net is used. In simple words you will need to use DataSet, DataAdapter and DataConnction objects.
However I would recommend you to Google the ‘Ado.net’ and get a complete overview before using this, because concept of Ado.Net is different from Adodc which was used with Visual Basic 6.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|