[RESOLVED] What is the diffrence between these two code samples?
Example given ( works fine)
Code:
private void listBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
// make sure they're actually dropping files (not text or anything else)
if( e.Data.GetDataPresent(DataFormats.FileDrop, false) == true )
// allow them to continue
// (without this, the cursor stays a "NO" symbol
e.Effect = DragDropEffects.All;
}
And my code for a CrystalReports viewer
I know the code doesnt do anythine persay but it wont even trigger the event thats what im wondering
Code:
private void crystalReportViewer1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
// make sure they're actually dropping files (not text or anything else)
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
// allow them to continue
// (without this, the cursor stays a "NO" symbol
e.Effect = DragDropEffects.All;
}
Re: What is the diffrence between these two code samples?
Did you just copy that into the code window or did you create the event handler in the Properties window? If it's the former then there's no connection between the method and the event you're trying to handle. You have to create that connection in the Properties window by either creating a new method or selecting an existing method to handle the event.
Re: What is the diffrence between these two code samples?
from the design window i selected the events of the crystal report viewer
selected Drag enter and double clicked it creating the
private void crystalReportViewer1_DragEnter(object sender, DragEventArgs e)
{
}
Code
I then cut and paste the "meat" of the code into that event handler
and when i drag something over the box i get nothing
Re: What is the diffrence between these two code samples?
Works for me. Did you set the AllowDrop property of the report viewer to true?
Re: What is the diffrence between these two code samples?