|
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
|
|
|
|
|
Hi,
I'm having troubles with XML deserialization in C#. Here is my class:
[Serializable]
public class A : IDeserializationCallback
{
public A()
{
m_MyString1 = "Test";
m_MyString2 = "";
}
public string MyString1
{
get { return m_MyString1; }
set { m_MyString1 = value; }
}
public string MyString2
{
get { return m_MyString2; }
set { m_MyString2 = value; }
}
void IDeserializationCallback.OnDeserialization(Object sender)
{
m_MyString2 = m_MyString1 + m_MyString1;
}
private string m_MyString1;
private string m_MyString2;
}
m_MyString2 is always "" in my case. Do I have to do anything else than implementing the interface to ensure that the OnDeserialization() method gets called?
Thanks in advance,
Rainer
|
|
|
|
|
Hey, I'm just about to go into my final year of school.
I have to do a programming project and I have decided to start early because what I have chosen to do will require a lot of learning on my part and a lot of work.
The project I have decided to do is an Internet Radio. I am currently building the server which has to stream the audio to the listeners as well as be semi-controlled by DJ's that will have a seperate application (developed by my partner). The client has to be developed in Delphi as thats the language that is taught at our school.
I am writing my server in C# because I think it's much better and would like to learn more.
I have run into some problems....
The way I have it now, I have a mediaplayer object that plays the music and an WMEncoder object that broadcasts it.
Problem 1:
Where the encoder gets its source: SrcAud.SetInput("Default_Audio_Device", "Device", "RadioStream");
This makes it capture the audio from the recording channel of my sound card (which by default is microphone), I have to change the channel to "What you hear" for the music to get broadcasted. This causes problems as you can imagine because any sound that is played on my computer also gets broadcasted with it.
Problem2:
The client (in Delphi) needs to send the server a stream of the DJ's voice that needs to be mixed into the broadcasted stream.
I can get Delhpi to record audio to a file, but I have no clue as to how I'm going to get the audio streamed and mixed into the server's broadcast.
If anyone has any suggestions, it would be GREATLY appreciated!
Thanks in advance.
df
|
|
|
|
|
Can't help you. But I'm curious...What school gives project like these?
What are you?
|
|
|
|