|
Use a ManualResetEvent that is triggered by the button click
only two letters away from being an asset
|
|
|
|
|
Sir, Please elaborate? Thanks.
|
|
|
|
|
|
make a recursive function and use a variable as the incrementer and in the button method increment the variable and call the function.
|
|
|
|
|
You asked this question 2 days ago. People answered you in that post - if you have problems with the solutions that people presented then, you should have the courtesy to reply to them on THAT post.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello Friends and Guru's
I am developing one Module for Drag-n-Drop Events.I was manage to fired Target control Drag_Enter events but Now, How can i know Actual dragged data.E.g. I am dragging one Picturebox1 to Picturebox2. Now how can i know picturebox1 in Picturebox2_DragEnter event.
I hav tried with the following Code snippets:
C#:
PictureBox pic=e.Data.GetData(DataFormats.Bitmap);//pic appear to be null.
Pls help me to get the data.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Can you tell me what line you used to start the drag and drop action? It should look something like DoDragDrop...
Because you might be trying to get a format that isn't there.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
I need to drag pic1 and drop in pic2.So, below is my code snippets:
pic1_mouseDown()
{
pic1.DoDragDrop(pic1.Image,DragEffect.Move)
}
pic2_DragEnter()
{
//here even i can identify pic1 entering in pic2 area
//here i even check whether pic1 is valid ctrl by e.GetDataFormat(),even
//that is working fine.But I need actual picture box i.e. pic1
//I hav tried this code to get pic1 in this event
PictureBox picSource=e.Data.GetData(DataFormat.Bitmap);
but here picSource appear to be null.
}
Pls help
}
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Try this:
void pic1_MouseMove(object sender,MouseEventArgs e) {
if(e.Button == Windows.Forms.MouseButtons.Left && !dragging) {
dragging = true;
pic1.DoDragDrop(pic1.Image,DragEffect.Move);
}
}
void pic2_DragOver(object sender,DragEventArgs e) {
e.Effect = DragEffect.None;
if(e.Data.GetDataPresent(typeof(Bitmap)) {
e.Effect = DragEffect.Move;
}
}
void pic2_DragDrop(object sender,DragEventArgs e) {
if(e.Data.GetDataPresent(typeof(Bitmap)) {
Bitmap img = (Bitmap)e.Data.GetData(typeof(Bitmap));
pic2.Image = img;
dragging = false;
}
}
This should work for your situation.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog i
|
|
|
|
|
how should i convert a byte stream to b played as wav file
|
|
|
|
|
You may use DirectX for this purpose. DirectX can read a wav file and play it afterwards. Download the DirectX SDK from Microsoft and search the C# samples. There are severa examples on how to do this. It is not very difficult.
|
|
|
|
|
Hey,
I created an application that plays the sound from a byte array. I took me some time to figure it out, and finally I used Microsoft DirectX SDK. I will give you the code, maybe it will help you:
<br />
public void PlaySound(Array soundBytes)<br />
{<br />
if (soundBytes == null)<br />
return;<br />
BufferDescription desc = new BufferDescription(InputFormat);<br />
desc.BufferBytes = soundBytes.Length;<br />
desc.ControlFrequency = true;<br />
desc.ControlPan = true;<br />
desc.ControlPositionNotify = true;<br />
desc.ControlVolume = true;<br />
secBuffer = new SecondaryBuffer(desc, _appDevice);<br />
secBuffer.Write(secBuffer.WritePosition, soundBytes, LockFlag.None);<br />
secBuffer.Play(0, BufferPlayFlags.Default);<br />
}<br />
The only thing you have to do is initialize the _appDevice object. Something like this:
<br />
_appDevice = new Device();<br />
_appDevice.SetCooperativeLevel(formHandle, CooperativeLevel.Priority);<br />
The form handle is the form which when is active can play the sound.
Hope it helps
Do your best to be the best
|
|
|
|
|
As a little pet project I wanted to make a little app that could read Microsoft Reader .lit files.
I have the Microsoft Content SDK and I've got myself a licence from Microsoft to use it but it seems you can only create .lit files using this. I know that some of the files need licences to open but I'm not interested in opening anything like this, just opening basic .lit files is all I want to do.
I've been searching the web for an hour now and I'm not having any luck. Has anyone had any experience reading .lit files?
Thanks!
Nick R
Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis.
I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it.
|
|
|
|
|
|
CLit is superb app, but only if you can find its binary or compile its source (I distinctly remember having some difficulties doing the latter, because main project is written in C or C++ and some parts are written in assembler). It basically decompiles LIT file into HTML and picture file(s) from which it is comprised.
Don't know if it can be P/Invoked, though.
|
|
|
|
|
Hi All.
Please help me. I would like to know how to convert an MS Word document to PDF and save that converted file on my local machine.
Thank You
Mpumelelo
khuzym
|
|
|
|
|
ITextSharp (programmatically)
CutePDF (Word Plugin)
|
|
|
|
|
Thank Vasudevan Deepak Kumar
I will try although I am no sure where to start
khuzym
|
|
|
|
|
On the button_click event
How we open an existing form?
Please send code..........
|
|
|
|
|
Hello,
If you have the instance of the From.
yourForm.Show();
or
yourform.ShowDialog();
All the best,
Martin
|
|
|
|
|
Hello Martin,
I've published the article as promised, please check it and vote for me;)
Gone With The Wind
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
For a MDI Application, You can open or show your mdi child forms from a mdi child form.
private void OpenFormIfNotExists(Form[] Formlar, Form MainForm, Form OpeningForm)
{
bool Foundf = false;
foreach (System.Windows.Forms.Form SearchingForm in Formlar)
{
if (OpeningForm.Name.Trim() == SearchingForm.Name.Trim())
{
SearchingForm.BringToFront();
Foundf = true;
break;
}
}
if (!Foundf)
{
System.Windows.Forms.Form OpForm = OpeningForm;
OpForm.MdiParent = MainForm;
OpForm.Show();
}
}
Usage:
OpenFormIfNotExists(this.MdiParent.MdiChildren, this.MdiParent, new MyNewMDIChildForm());
Umit
|
|
|
|
|
Hello,
I have a small problem. I built a ASP.NET WebService that retrieves data from a database. I have a function in the webservice that receives a parameter, and the return type is an object created by me. UserInfoCollection is a class created by me that contains an ArrayList with will cotain several UserInfo objects.
This is the function in the webservice:
<br />
[WebMethod]<br />
public UserInfoCollection GetUsersByType(AccountTypes account)<br />
{<br />
UserInfoCollection collection = new UserInfoCollection();<br />
<br />
<br />
return collection;<br />
}<br />
To use the methods from the webservice I build a proxy using the WSDL utility. This is how i use this function:
<br />
WSService ws = new WSService();<br />
UserInfoCollection _uicUsers = ws.GetUsersByType(type);<br />
Using debug mode I saw that the webservice inserts into the collection everything that he has to, but when the webservice returns the collection object, in the application the object has no values inside. After the return statement, the webservice reinitializez the object. My question is that anyone has a suggestion to get past this problem.
Thank you.
Do your best to be the best
|
|
|
|
|
Are your UserInfoCollection and UserInfo classes marked as Serializable?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey,
First of all thanks for your reply.
The classes are not marked as Serializable, but I also have a function in the WebService that returns a UserInfo object and it works perfect. If I use the UserInfoCollection...problems. I found some way to go around, but this bugs me a lot...because I can't understand why it's doing this.
Do your best to be the best
|
|
|
|