Click here to Skip to main content
15,891,633 members
Home / Discussions / C#
   

C#

 
GeneralRe: Non Rectanglular forms Pin
Nnamdi Onyeyiri5-Oct-02 23:29
Nnamdi Onyeyiri5-Oct-02 23:29 
GeneralRe: Non Rectanglular forms Pin
David Stone6-Oct-02 11:45
sitebuilderDavid Stone6-Oct-02 11:45 
GeneralRe: Non Rectanglular forms Pin
Nnamdi Onyeyiri6-Oct-02 20:12
Nnamdi Onyeyiri6-Oct-02 20:12 
QuestionA problem with some GDI+ example? How to avoid it? Pin
Zibar4-Oct-02 21:09
sussZibar4-Oct-02 21:09 
AnswerRe: A problem with some GDI+ example? How to avoid it? Pin
Nick Parker5-Oct-02 1:59
protectorNick Parker5-Oct-02 1:59 
GeneralDirectorySearcher Pin
WizardOfPeyton4-Oct-02 15:37
WizardOfPeyton4-Oct-02 15:37 
GeneralRe: DirectorySearcher Pin
Mazdak5-Oct-02 9:20
Mazdak5-Oct-02 9:20 
GeneralQuestion about drag and drop Pin
Wjousts4-Oct-02 15:36
Wjousts4-Oct-02 15:36 
I'm have two listboxes and I have to set it up so I can drag items from one box to the other, including multiple items if they are selected with the ctrl or shift key. I've got it working at the moment, but it seems like a horrible cludge and I wondered if they're isn't a better way?
This is what I'm doing:

For the source listbox (it only has to go one way, BTW), I set up the ItemDrag event to create a DataObject and then set it to the SelectedItems[0] with the DataFormats.Serializable because apparently the collection it's self isn't serializable. Then I call DoDragDrop with my DataObject.

For the target box I set the DragEnter event to first check if the data is Serializable using GetDataPresent. I then try casting the data to a ListViewItem (catching the exception if it won't cast). Then, if it casted okay I check that it actually came from right ListViewBox. If all these tests are passed I set DragDropEffects to Copy (otherwise none).
Then for the DragDrop event in the target box I just ignore the data being passed (because it was already checked by DragEnter) and just copy all the SelectedItems into the target box.

It seems to work okay, but it doesn't seem like the most elegant way of doing things. Does anybody have a better or more efficent routine? Also, is there any simple way to get the outline dragging that you see in Explorer? If so how do you go about this?

Thanks

WJ
Questionwindows services ? Pin
imran_rafique4-Oct-02 15:12
imran_rafique4-Oct-02 15:12 
AnswerRe: windows services ? Pin
Paul Riley4-Oct-02 23:35
Paul Riley4-Oct-02 23:35 
GeneralRe: windows services ? Pin
David Stone5-Oct-02 12:49
sitebuilderDavid Stone5-Oct-02 12:49 
AnswerRe: windows services ? Pin
Alex Korchemniy5-Oct-02 6:35
Alex Korchemniy5-Oct-02 6:35 
AnswerRe: windows services ? Pin
jparsons5-Oct-02 18:20
jparsons5-Oct-02 18:20 
GeneralRe: windows services ? Pin
imran_rafique6-Oct-02 15:25
imran_rafique6-Oct-02 15:25 
Generalownerdraw for a listview Pin
Darryl Borden4-Oct-02 11:27
Darryl Borden4-Oct-02 11:27 
GeneralRe: ownerdraw for a listview Pin
David Stone6-Oct-02 11:46
sitebuilderDavid Stone6-Oct-02 11:46 
GeneralText file encoding... Pin
Luca Leonardo Scorcia4-Oct-02 7:06
professionalLuca Leonardo Scorcia4-Oct-02 7:06 
GeneralRe: Text file encoding... Pin
Paul Riley4-Oct-02 7:39
Paul Riley4-Oct-02 7:39 
GeneralRe: Text file encoding... Pin
Luca Leonardo Scorcia4-Oct-02 9:59
professionalLuca Leonardo Scorcia4-Oct-02 9:59 
GeneralRe: Text file encoding... Pin
leppie4-Oct-02 12:36
leppie4-Oct-02 12:36 
GeneralRe: Text file encoding... Pin
Paul Riley4-Oct-02 13:18
Paul Riley4-Oct-02 13:18 
GeneralRe: Text file encoding... Pin
Luca Leonardo Scorcia5-Oct-02 7:07
professionalLuca Leonardo Scorcia5-Oct-02 7:07 
GeneralRe: Text file encoding... Pin
Paul Riley5-Oct-02 7:33
Paul Riley5-Oct-02 7:33 
GeneralAutomatically have a certain tab selected when a tree control node is selected. Pin
Derek Smigelski4-Oct-02 6:23
Derek Smigelski4-Oct-02 6:23 
GeneralMDI application lost focus when GroupBox has button control in it Pin
Zaharang3-Oct-02 20:59
Zaharang3-Oct-02 20:59 

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.