|
Nilish wrote: so three steps
on the other hand just one line of code
call functionname()
The point of a delegate is that you do separate the process in several steps.
Consider this scenario:
Person A has written a class that person B will use.
Person A has declared a delegate in the code.
Person B provides the reference for the delegate.
Person A has written code that uses the delegate, without needing to know at the time what it will be referencing.
---
single minded; short sighted; long gone;
|
|
|
|
|
Nilish wrote: isn't that good to accomplish something in less lines of code.
We're in the VB forum... and you want to do things with less code.
Nilish wrote: first i am declaring the delegate
then i am providing the reference of the function.
then i am invoking it.
so three steps
on the other hand just one line of code
call functionname()
Well, since delegates are used heavily in event handlers, you might like to work out how many lines of code the equivalent would take without the existance of delegates. Then you will see where you are saving lines of code.
The example shown earlier is, as I've said, contrived to show you how delegates work. It is NOT an example of where or why you would use one, as I've also said before.
|
|
|
|
|
Hello,
VS 2005
Passing data using events between child and parent is not difficult. But how would you handle a event from another form that didn't create instance of that form.
For example. form1, form2, form3.
form1 open form2.
form2 open form3.
How can you handle an event in form1 which has been raised in form3? The 2 are independent of each other, as form1 doesn't have an object for form3.
I have a button on form3 that when pressed should pass some data to form1.
Thanks
|
|
|
|
|
Add 1 module
'Write This line
Public Module Globals
Public Form1Ref as Form
End Module
In the constructor of form1, write
FormRef=Me
Access FormRef from Form3
|
|
|
|
|
steve_rm wrote: How can you handle an event in form1 which has been raised in form3?
You can't. Form1 doesn't even know that an instance of Form3 exists. Form2 would have to subscribe to and handle the event comming from Form3, then, in response to this event, raise an event of it's own that Form1 would have to subscribe to.
|
|
|
|
|
hi,
i get the following error:
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How it can be resolved.
Thanks,
SD
|
|
|
|
|
r u adding any control?
If yes then the control is not getting the memory. I think
like in vb.net u r adding MSFlexGrid
But at runtime there are problems regarding the memory assignment
-- modified at 7:32 Tuesday 15th May, 2007
|
|
|
|
|
I currentl using VB.NET 2005 with small project, after package and install to client machine i need my application run in services.
Please help me
Regard
Socheat
................
|
|
|
|
|
in service,you should use process.run(" application path")
import necessary namespace
|
|
|
|
|
I know but i want to start it aumomatically after packaged
................
|
|
|
|
|
Then you'll have to write your application AS a service project. There's a template in every edition of Visual Studio .NET, except the Express Editions.
|
|
|
|
|
Hey
I am using vb.net in vs2k5 and .net2.0. I have searched online to try and find a way to create text boxes (on a windows form) with a little bit more of a modern look &= slightly rounded corners. I can't think of anything to search for that doesn't give me back loads of irrelevant answers.
I'm thinking that there must be a reasonably simple way to pull this off.
If someone can kindly point me in the right direction I would appreciate it.
Thanks
|
|
|
|
|
Override OnPaint method and draw whatever shape you want
|
|
|
|
|
Ok, I've never tried anything like that for a textbox. It may be simple, but if someone has a quick example, that could be helpful..
Thanks for the response.
|
|
|
|
|
dear friends,
can any one of you tell me how to verify whether the right click
is on row heading or on the worksheet cell in Excel.
i need to catch this event in my VBA code.
thanks and regards
prahant
|
|
|
|
|
hi there,
I have read some articles on event , raise event , delegates ,SerializATION
None of them exactly explains it's utility in real life projects.
I just need one or two simple advantages that y should i use these terms in the projects.
Please refer articles that briefly explains it's advantages.
|
|
|
|
|
Well I think that you will find events and delegates useful by just attempting to build Windows Application with GUI. If your applcation will grow a bit, then you'll find also useful raising events.
Well Serialization will come into play as your application will need to remember it's last execution state (or even if you need to make some operation undo-able).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi there,
i have a long operation in the form that continues fo 12-15 minutes.
Now my question is
1.Can i show the progress bar in different window that show the pogress of the operation.currently i am using the PROGRESS BAR IN THE DIFFERENT WINDOW.
2.Does SHOW/SHOWDIALOG has anything to do with this problem?
|
|
|
|
|
1. First of all you have not written your problem clearly. You are currently using progressbar in different window. then what is the problem?
2. SHOW/SHOWDIALOG does not effect anything in this problem
|
|
|
|
|
There are two different versions of anything called a "Progress Bar".
The first is one where the progress bar goes from 0% to 100%. In order for this to work, your code has to know where the stopping point is in order to generate a value that can go from 0 to 100. It also has to update the progress bar (noone cares what form it's on!) every once in a while with the current value of the progress.
The second is a progress bar that doesn't, well, progress. What that means is that your code doesn't need to know how long a process will take or show any actual progress. The progress bar just displays a moving image that show something is going on. It has no idea how long the process will take or how long it has yet to go.
So, which is it for you?
|
|
|
|
|
Hi there,
I know there is no pointer concept in vb.net.
Now my question is
Does self referential classes has anything to do with the pointers?
If yes can somebody refer an article to understand it?
|
|
|
|
|
Nilish wrote: Does self referential classes has anything to do with the pointers?
No, but it can be implemented with pointers. As the name suggests a "Self referential" class is one that referes to itself (usually a different instance). In .NET this would be done with references (another hint the name of the concept gives you).
|
|
|
|
|
Colin , can u provide an article ?
|
|
|
|
|
Nilish wrote: can u provide an article ?
Have you tried Google?
|
|
|
|
|
yes , i have . But specifically with pointers , I am not getting ... the thing which was intended
|
|
|
|