Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
QuestionTreeview problem Pin
Mridang Agarwalla27-Mar-06 6:57
Mridang Agarwalla27-Mar-06 6:57 
AnswerRe: Treeview problem Pin
Wjousts27-Mar-06 10:53
Wjousts27-Mar-06 10:53 
QuestionDeleting my control from form does not remove code Pin
cnich2327-Mar-06 6:52
cnich2327-Mar-06 6:52 
QuestionRestart application on error Pin
Mridang Agarwalla27-Mar-06 6:51
Mridang Agarwalla27-Mar-06 6:51 
AnswerRe: Restart application on error Pin
Mr.Jocker27-Mar-06 7:45
Mr.Jocker27-Mar-06 7:45 
AnswerRe: Restart application on error Pin
Ed.Poore27-Mar-06 8:57
Ed.Poore27-Mar-06 8:57 
GeneralRe: Restart application on error Pin
Expert Coming29-Mar-06 12:35
Expert Coming29-Mar-06 12:35 
QuestionDrag and Drop Label in a Panel Pin
cbeasle127-Mar-06 5:40
cbeasle127-Mar-06 5:40 
I am trying to do a drag and drop. The idea is to drag from a listbox and create an instance of a label or a class that contains a label as a member, and drop the label to a panel to drop. Once on the panel the label need to moveable (drag and drop) in the panel. I also need to be able to store the x and y location of the label reletive to the panel. I can wait on the x and y stuff for now. I mainly need to get the label to appear in the panel with the text of the associate listbox item. Here is the code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MullinsReqStar
{
public partial class Form1 : Form
{
Image bkgrnd_image;
Label[] lblList = new Label[25];

int count = 0;

public Form1()
{
InitializeComponent();
this.Text = "Mullins ReqStar";
}


private void lbItems_MouseDown(object sender, MouseEventArgs e)
{
lbItems.DoDragDrop(lbItems.Items[lbItems.SelectedIndex].ToString(), DragDropEffects.Copy | DragDropEffects.Move);
}

private void pnlImageBorder_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
//string strTest = lbItems.Items[lbItems.SelectedIndex].ToString();
//lblList[lbItems.SelectedIndex].Text = lbItems.Items[lbItems.SelectedIndex].ToString();
}

private void pnlImageBorder_DragDrop(object sender, DragEventArgs e)
{
//lblList[lbItems.SelectedIndex].Text = lbItems.Items[lbItems.SelectedIndex].ToString();
string strXTest = e.X.ToString();
string strYTest = e.Y.ToString();
lblList[lbItems.SelectedIndex].Location = new Point(e.X, e.Y);
}

}
}





Thanks
cbeasle1
AnswerRe: Drag and Drop Label in a Panel Pin
Ravi Bhavnani27-Mar-06 6:55
professionalRavi Bhavnani27-Mar-06 6:55 
QuestionPlz help me convert .doc to any image format Pin
Petrus_Alex27-Mar-06 5:29
Petrus_Alex27-Mar-06 5:29 
QuestionMimic Mouse Click Pin
royk12327-Mar-06 5:29
royk12327-Mar-06 5:29 
AnswerRe: Mimic Mouse Click Pin
Glaxalg27-Mar-06 8:28
Glaxalg27-Mar-06 8:28 
GeneralRe: Mimic Mouse Click Pin
royk12327-Mar-06 17:05
royk12327-Mar-06 17:05 
QuestionToolbox Bug Pin
Dominik Reichl27-Mar-06 5:20
Dominik Reichl27-Mar-06 5:20 
AnswerRe: Toolbox Bug Pin
Jared Parsons27-Mar-06 19:27
Jared Parsons27-Mar-06 19:27 
QuestionFinding unsuccessful updates Pin
Mark0627-Mar-06 4:34
Mark0627-Mar-06 4:34 
AnswerRe: Finding unsuccessful updates Pin
Ricardo Casquete27-Mar-06 5:31
Ricardo Casquete27-Mar-06 5:31 
QuestionHow to cast an int to a String [novice] Pin
Inkimar27-Mar-06 4:29
Inkimar27-Mar-06 4:29 
AnswerRe: How to cast an int to a String [novice] Pin
Jimbo2227-Mar-06 4:38
Jimbo2227-Mar-06 4:38 
AnswerRe: How to cast an int to a String [novice] Pin
Stanciu Vlad27-Mar-06 4:59
Stanciu Vlad27-Mar-06 4:59 
QuestionC# for PDA Pin
hung_ngole27-Mar-06 4:02
hung_ngole27-Mar-06 4:02 
AnswerRe: C# for PDA Pin
Judah Gabriel Himango27-Mar-06 4:15
sponsorJudah Gabriel Himango27-Mar-06 4:15 
QuestionProblems with File Download Pin
SreekanthJ27-Mar-06 3:51
SreekanthJ27-Mar-06 3:51 
GeneralRe: Problems with File Download Pin
Guffa27-Mar-06 7:09
Guffa27-Mar-06 7:09 
QuestionPlease help about TableAdapter Pin
emran83427-Mar-06 3:32
emran83427-Mar-06 3:32 

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.