Click here to Skip to main content
15,887,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to solve this error in vb.net code? Pin
Christian Graus11-May-07 1:40
protectorChristian Graus11-May-07 1:40 
AnswerRe: how to solve this error in vb.net code? Pin
Dave Kreskowiak11-May-07 3:42
mveDave Kreskowiak11-May-07 3:42 
QuestionDataGridView Readonly Question Pin
_mubashir11-May-07 0:50
_mubashir11-May-07 0:50 
AnswerRe: DataGridView Readonly Question Pin
Dave Kreskowiak11-May-07 3:38
mveDave Kreskowiak11-May-07 3:38 
GeneralRe: DataGridView Readonly Question Pin
_mubashir11-May-07 6:07
_mubashir11-May-07 6:07 
GeneralRe: DataGridView Readonly Question Pin
_mubashir11-May-07 8:05
_mubashir11-May-07 8:05 
Questiondrag and drop problem... vb .net Pin
daxfrost11-May-07 0:09
daxfrost11-May-07 0:09 
AnswerRe: drag and drop problem... vb .net Pin
PandemoniumPasha11-May-07 0:59
PandemoniumPasha11-May-07 0:59 
hi,
to do this, you need to set the allowdrop porperty of the control to true.
then you need to write two event-handlers to handle the events fired when you do drag & drop operation.

below is a code sample in C# but you can easily convert it to VB

//you need to set the property and assign eventhandlers
this.richtextbox1.Allow = true;
this.richtextbox1.DragDrop += new DragEventHandler(richtextbox1_DragDrop);
this.richtextbox1.DragEnter += new DragEventHandler(richtextbox1_DragEnter);


//then write the event handlers
private void richtextbox1_DragEnter(object sender, DragEventArgs e)
{
if(e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}


private void richtextbox1_DragDrop(object sender, DragEventArgs e)
{
if(e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] file = (string[])e.Data.GetData(DataFormats.FileDrop);
fileName = file[0];
//Now that you have the file name of the file, you can read it and display its contents
}
}


hope this helps.
regards
Smile | :)
AnswerRe: drag and drop problem... vb .net Pin
Sonia Gupta11-May-07 1:11
Sonia Gupta11-May-07 1:11 
GeneralRe: drag and drop problem... vb .net Pin
daxfrost11-May-07 1:28
daxfrost11-May-07 1:28 
GeneralRe: drag and drop problem... vb .net Pin
Sonia Gupta11-May-07 1:31
Sonia Gupta11-May-07 1:31 
GeneralRe: drag and drop problem... vb .net Pin
daxfrost11-May-07 1:40
daxfrost11-May-07 1:40 
GeneralRe: drag and drop problem... vb .net Pin
Sonia Gupta11-May-07 1:50
Sonia Gupta11-May-07 1:50 
GeneralRe: drag and drop problem... vb .net Pin
daxfrost11-May-07 1:57
daxfrost11-May-07 1:57 
GeneralRe: drag and drop problem... vb .net Pin
Sonia Gupta11-May-07 2:04
Sonia Gupta11-May-07 2:04 
GeneralRe: drag and drop problem... vb .net Pin
Christian Graus11-May-07 2:33
protectorChristian Graus11-May-07 2:33 
GeneralRe: drag and drop problem... vb .net Pin
Dave Kreskowiak11-May-07 3:36
mveDave Kreskowiak11-May-07 3:36 
GeneralRe: drag and drop problem... vb .net Pin
daxfrost11-May-07 6:07
daxfrost11-May-07 6:07 
Questionmouse events vb.net 2005 Pin
Sonia Gupta10-May-07 23:34
Sonia Gupta10-May-07 23:34 
AnswerRe: mouse events vb.net 2005 Pin
Christian Graus10-May-07 23:46
protectorChristian Graus10-May-07 23:46 
GeneralRe: mouse events vb.net 2005 Pin
harsh_c11-May-07 0:55
professionalharsh_c11-May-07 0:55 
GeneralRe: mouse events vb.net 2005 Pin
Christian Graus11-May-07 1:55
protectorChristian Graus11-May-07 1:55 
QuestionTalk to an EPP server Pin
shahid_isb8510-May-07 23:21
shahid_isb8510-May-07 23:21 
QuestionVBA-Excel: User Name and eMail Problem [modified] Pin
RichardBerry10-May-07 22:50
RichardBerry10-May-07 22:50 
QuestionUpdate Table gets message "parameter has no default value" Pin
keninfo10-May-07 22:10
keninfo10-May-07 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.