|
Seperate your code into layers, such as Data Access and Business Logic. If you place the code to access your data into another class with a method that returns a DataSet then you can bind the controls on both forms to the same source, possibly using a ObjectDataSource control.
only two letters away from being an asset
|
|
|
|
|
Hello
I've a problem. I use DShowNet to send view from my camera to panel in C#. I would like to take position from this panel. I try to use "OnMouseMove", but it's not working. Any idea? Thanks, and sorry for my english.
|
|
|
|
|
RockyC# wrote: I would like to take position from this panel.
What exactly do you mean? In case you're interested in the panel's position on the form, the Location property is what you're looking for.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
No. I want to get mouse's position (X and Y) on panel.
|
|
|
|
|
Register an event handler to the MouseMove event of your panel and retrieve the mouse coordinates from the passed MouseEventArgs instance.
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
private void panel1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
int mouseX = e.X;
int mouseY = e.Y;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
But if you use this panel to show view from camera, then that's not working.
|
|
|
|
|
|
Ok, how do you use the panel to show the camera view; did you put some control onto the panel which does that for you? If that's the case and this control has a MouseMove event, subscribe your event handler to this.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I've used this code DirectShow.NET to capture a view.
I think You have right. This code put something on panel, but I don't know what exactly. Maybe it's videoWin (IVideoWindow class), because there is added handle to my panel.
-- modified at 11:34 Sunday 7th January, 2007
|
|
|
|
|
how to import and export favorites using C# code?
chirag surati.
Thanx in Advance!
|
|
|
|
|
Favorite what?
only two letters away from being an asset
|
|
|
|
|
wats an ASSET?
actually i m developing Bookmark Manager!
for tat i need to learn how to import and export favorites from any web browser.
i mean using C# code.
|
|
|
|
|
An asset is something that is of value to you. It's a sig, not a comment to you.
chirag_nine wrote: actually i m developing Bookmark Manager!
for tat i need to learn how to import and export favorites from any web browser.
You need to work out how each browser stores them. I think IE stores them as HTML, so you just need to know where to look for them. There's no central API, you're talking about how different browsers work, you need to research that and then work with the info you find.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a problem while making dll. i write methods in to dll and on my project i give reference and task(i am sure that i have no mistake at using dll part) but i when i use dll method debugger gives me this method is in (ExDll.dll)
how can create a methods in dll, can any one give me step by step solution.
Thanks
Best Regards
|
|
|
|
|
Create a dll project
add a method
compile
Unless there's something you're not telling us, there are no special steps required. What is your problem ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I assumed that i have added a method but after i included it vs doesnt see this method
here is the dll code
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace ExDLL<br />
{<br />
public class Class1<br />
{<br />
public static int ExMethod(int a, int b)<br />
{<br />
return a + b;<br />
}<br />
}<br />
}<br />
Thanks, i wait your reply
|
|
|
|
|
The line ExDLL.Class1.ExMethod(1, 2) will return 3, if you have a reference to the DLL in your project. The most common mistake here, is to forget about scoping the namespace, either directly or with a using statement.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hello;
In .net side, after i add reference to dll, should i use it like
int r = ExDLL.Class1.ExMethod(3,4);
|
|
|
|
|
Yes, unless you have using ExDLL inside the class.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
How to make a MaskedTextBox in Visual Studio 2003.
Vasildb
|
|
|
|
|
|
Hi,
I'm currently working on a library which deals with sockets.
One of the classes I wrote is Buffer , which is generic.
It is declared like so:
public class Buffer<TPack> where TPack : IPack<TPack> { ... } The IPack interface defines, amongst others, the following function signature:
TPack FromReceivedData(byte[] data, int startIndex); My problem is to force the implementers to declare FromReceivedData() as static.
Interfaces do not allow it.
What should I do?
Hopefully I've supplied enough information.
If you need to know more in order to understand the problem, please tell me and I'll post some more code snippets.
Thanks in advance,
Shy.
|
|
|
|
|
If the interface defines it then it must be instance.
If you want it static use an abstract class.
Also, you will have to write a generic method because the static method will not use the Generics from the instance.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Why do you want it to be static? Then the only way for you to call it would be to use reflection.
The reason that interfaces can not contain static methods is that you can not call a static method using an interface. You need to specify the actual class to call a static method.
---
Year happy = new Year(2007);
|
|
|
|
|
hi all,
i try to scan a word document for a string and then to write the sentences containing this string to a new "result" document (also word). now, how do i get the line number of this sentence and how can i write each found sentence on a new line in my resultdocument?
i tried like this:
sentence.Find.Text = tofind;
bool present = docrange.Find.Execute(ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,ref nullobj, ref nullobj);
//results is the the document for the found sentences
resrange = results.Range(ref nullobj, ref nullobj);
if (present == true)
{
--> here starts my problem
how can i get the line number of "sentence" (where i found it)? and how can i fill "resrange" line for line with the found sentences? InsertAfter isn't the right solution i think.
resrange.InsertAfter(sentence.Text);
}
thanks for help
hofi
|
|
|
|