|
Just add the dll to the toolbox, close VS, open it again, look at the toolbox, you will notice it is still there, and will be there till you remove it manually.
|
|
|
|
|
I would like to create a method that within the method it will handle the mouse click event and after the user has input 2 points the method will return a value back to the caller.
void Test(){
/* The Drawline method should allow user to click the left mouse button 2 times to accept 2 points,after that the DrawLine method will return a true value;*/
bool isDraw = DrawLine();
}
Anyone know what should I do within the DrawLine() method? All help is appreciated. Thanks.
|
|
|
|
|
TaiZhong wrote: I would like to create a method that within the method it will handle the mouse click event and after the user has input 2 points the method will return a value back to the caller.
What has this to do with multi-threading? Anyway, return what value back to the caller? What caller? You need to handle the mouse button down/up events I expect.
Post your code for further assistance.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am sorry, I am not sure whether its something do to with multithreading or not. You can forget about the "caller" if this terms confuse you (Caller means those who call this DrawLine() method). I just want to know how to make the program to stop at the DrawLine() method and after I have accept 2 points from the mouse down button then will return a true value back from the DrawLine method and after that the program will proceed.
void Test(){
/* The program should wait untill I accept 2 points from the mouse down event after that a true value will return by DrawLine() to "temp" variables */
bool temp= DrawLine();
}
I don't know what should I handle within the DrawLine() method.
|
|
|
|
|
The exact way describe is not possible in .NET or most languages for that matter.
To do it (exactly) like you show, your language will need to support continuations (only Ruby and Scheme does that AFAIK).
The solution to your problem is to rethink the problem, and design it so it can be handled by the platform/language.
|
|
|
|
|
I am using a third party components and it is written by C# .NET and there is a method that works exactly like what I have described previously I wonder how they did it?
|
|
|
|
|
Just handle the mouse click event and have a counter var in your class, increment it each time the click event happens and call the drawline method, in the drawline method check the counter, if it's the amount you want (2 in your case) reset it back to 0 and return true.
|
|
|
|
|
I have a question, if you want the program to stop at a method (drawLine() in my case), isn't it there must be a loop inside that method and loop untill the user have click the mouse button 2 times and only stop the loop and return a value?
|
|
|
|
|
hi.
how to give space between each section in crystal report
|
|
|
|
|
Please don't ask twice.
Have you tried google ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
And somehow you cannot do this in the designer?
|
|
|
|
|
can u be more specific with what u r looking for ???
|
|
|
|
|
hi i am using crystal report in windows appliction
i am getting output from my database as...
data data data
data data data
data data data
data data data
tell me how to extend height between these datas in crystal repor
regards,
vidhya.s
|
|
|
|
|
Is there a simple way of setting MustUnderstand in WCF?
I have a project which uses WSE to connect to a java web service. In order to get it working I had to change the mustunderstand property on the client which was a simple one line if I recall
e.g.
requestContext.Security.MustUnderstand = false
How do I achieve the same using WCF?
modified on Wednesday, June 25, 2008 9:33 AM
|
|
|
|
|
Could not find a straightforward way of doing this client side.
To fix this I had to ammend the java class to add "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" to the list of understood headers.
|
|
|
|
|
Hi, I have a question on correct usage of object composition. This is the situation I'm facing:
class Address
{
private byte _FieldA;
private byte _FieldB;
private byte _FieldC;
public byte FieldA
{
set { _FieldA = value; }
get { return _FieldA; }
}
public void SetAddress (byte fieldA, byte fieldB, byte fieldC);
public void DoStuff(...)
public void DoOtherStuff(...)
...
}
class Message
{
public Address SourceAddress = new Address();
public Address DestAddress = new Address();
}
A client which instantiates a message should only be able to access the address fields and to invoke SetAddress().
By declaring SourceAddress and DestAddress objects as public, I can write things like message.SourceAddress.FieldA , message.DestAddress.SetAddress() , with no need for additional code. However, I also expose other methods like DoStuff() etc, which a message should not be able to call.
On the other hand, if I declare SourceAddress and DestAddress as private, I can control what I expose to the client but I'm also forced to add a lot of code: public properties and methods like SourceAddressFieldA , SourceAddressFieldB , SetSourceAddress() , all duplicated for DestAddress ... this means a lot of code duplication, and less flexibility (imagine if I have to add other Address fields to Message ...).
Is there a "sweet spot"? Is there a correct (or better, preferred) way to expose the behaviour of child objects in C#?
Regards,
Andrea
|
|
|
|
|
I think the best way is to make Address use an interface which defines the methods you want the Message to have access to. Then do public IPublicAddress SourceAddress = new Address(); This means that the Message class can only access the methods you want it to.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi i created a dll in which i create a wizard
plz any body can tell me how i can run this dll using C# code
so that when dll execute the Wizard starts
wasim khan
|
|
|
|
|
You can't run a dll. You write an app that imports the dll, and calls methods in it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi Chris
then how my application run the dll that is downloaded by the System Configurator
wasim khan
|
|
|
|
|
Your app can probe any dll via reflection, or it can be built to import a dll, then it can call it directly.
Well, so long as it's a .NET dll. otherwise, you can p/invoke or call via COM, but you can't reflect, so you'd need to know about it at compile time.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
use unmanaged code to access your dll and use managed or direct call to your method
example
using System;
using System.Runtime.InteropServices
class UnmanagedAccessDll
{
[DllImport("myDll.dll")]
public static extern void StartWizard([required parameters if any]);
}
public ManagedAccessDll
{
public void Startwizard([required parameters if any]){
UnmanagedAccessDll.Startwizard([required parameters if any]);
}
}
or you can call directly in your code
...
UnmanagedAccessDll.Startwizard([required parameters if any]);
...
|
|
|
|
|
can someone know how to put a code on a treeview node??
where can i find the mdichild form..
there is no mdi child form on the when i clicked project then add form..
ginji
|
|
|
|
|
Do you mean how to create a TreeNode in code and add it to a TreeView? If so:
TreeNode node = new TreeNode("Node Text");
treeView1.Nodes.Add(node);
MDI children are just normal forms which is why there's no automatic MDIChildForm option.
Set the parent form's IsMdiContainer property to true, and after you instanciate the child form, set it's MdiParent property to the parent form. i.e.
Form2 form2 = new Form2();
form2.MdiParent = this;
form2.Show();
Dave
|
|
|
|
|
i mean how to put a code in a node for example if i click node1 another form opens then if i click node2 the form is disabled...
mdichild
thanks i created a mdi child form can i also how can i close the mdichild form and goes back to the mdiparent because if i hide the mdichild the mdiparent also hides.
modified on Wednesday, June 25, 2008 9:27 PM
|
|
|
|