本文整理汇总了C#中DragEventHandler类的典型用法代码示例。如果您正苦于以下问题:C# DragEventHandler类的具体用法?C# DragEventHandler怎么用?C# DragEventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DragEventHandler类属于命名空间,在下文中一共展示了DragEventHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditorHelper
private string[] snippets = { }; //{ "diag_log \"\";", "for \"_i\" from 1 to 10 do { debugLog _i; };", "call compile preprocessFileLine Numbers \"\";" };
#endregion Fields
#region Constructors
public EditorHelper(
EventHandler<TextChangedEventArgs> textAreaTextChanged,
EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
KeyEventHandler textAreaKeyUp,
EventHandler textAreaSelectionChangedDelayed,
DragEventHandler textAreaDragDrop,
DragEventHandler textAreaDragEnter,
TabControl mainTabControl,
AutocompleteMenu armaSense,
DashGlobal dashGlobal)
{
TextAreaTextChanged = textAreaTextChanged;
TextAreaTextChangedDelayed = textAreaTextChangedDelayed;
TextAreaKeyUp = textAreaKeyUp;
TextAreaSelectionChangedDelayed = textAreaSelectionChangedDelayed;
TextAreaDragDrop = textAreaDragDrop;
TextAreaDragEnter = textAreaDragEnter;
MainTabControl = mainTabControl;
ArmaSense = armaSense;
DashGlobal = dashGlobal;
ArmaListItemsCount = 0;
ArmaSenseKeywords = new List<AutocompleteItem>();
foreach (var item in keywordList)
{
ArmaSenseKeywords.Add(new AutocompleteItem(item) { ImageIndex = 0, ToolTipTitle = "Arma Script Command", ToolTipText = item });
}
}
示例2: InitializeEvents
/// <summary>
/// Initialize class events.
/// </summary>
private void InitializeEvents()
{
TextChanged += new EventHandler(HandleTextChanged);
UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);
// enable drag & drop
AllowDrop = true;
DragOver += new DragEventHandler(HandleDragOver);
DragDrop += new DragEventHandler(HandleDragDrop);
// search & replace
KeyUp += new KeyEventHandler(HandleKeyUp);
KeyDown += new KeyEventHandler(HandleKeyDown);
InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
MouseWheel += new MouseEventHandler(HandleMouseWheel);
Painted += new EventHandler<EventArgs>(HandlePainted);
// create default pens
grayPen = new Pen(Brushes.Gray);
dashedPen = new Pen(Brushes.LightGray);
dashedPen.DashPattern = new[] { 3f, 6f };
// measure default line size
lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
}
示例3: AttachmentView
public AttachmentView()
{
// columns
ColumnHeader FileName = new ColumnHeader();
FileName.Text = WbLocale.FileName;
FileName.Width = 100;
ColumnHeader Size = new ColumnHeader();
Size.Text = WbLocale.Size;
Size.Width = 40;
Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { FileName, Size});
// details view
View = View.Details;
// drag n drop
AllowDrop = true;
DragEnter += new DragEventHandler(AttachmentView_DragEnter);
DragDrop += new DragEventHandler(AttachmentView_DragDrop);
ItemDrag += new ItemDragEventHandler(AttachmentView_ItemDrag);
// item activate
Activation = ItemActivation.Standard;
ItemActivate += new EventHandler(AttachmentView_ItemActivate);
// context menu
MenuItem ins = new MenuItem(WbLocale.Insert);
ins.Click += new EventHandler(insert_Click);
deleteMenuItem = new MenuItem(WbLocale.Delete);
deleteMenuItem.Click += new EventHandler(delete_Click);
ContextMenu = new ContextMenu(new MenuItem[] { ins, deleteMenuItem });
ContextMenu.Popup += new EventHandler(ContextMenu_Popup);
}
示例4: MLifterTextBox
/// <summary>
/// Initializes a new instance of the <see cref="MLifterTextBox"/> class.
/// </summary>
/// <remarks>Documented by Dev05, 2007-09-19</remarks>
public MLifterTextBox()
{
AllowAnswerSubmit = true;
BorderStyle = BorderStyle.None;
Font = new System.Drawing.Font("MS Sans Serif", 14, System.Drawing.FontStyle.Bold);
SelectionAlignment = HorizontalAlignment.Center;
//ScrollBars = RichTextBoxScrollBars.ForcedVertical;
AllowDrop = true;
DragEnter += new DragEventHandler(MLifterTextBox_DragEnter);
DragDrop += new DragEventHandler(MLifterTextBox_DragDrop);
MouseDown += new MouseEventHandler(MLifterTextBox_MouseDown);
Leave += new EventHandler(MLifterTextBox_Leave);
ContentsResized += new ContentsResizedEventHandler(MLifterTextBox_ContentsResized);
caseSensitive = false;
correctOnTheFly = false;
StripChars.Add("\n\r");
StripChars.Add("\r\n");
StripChars.Add("\n");
//StripChars.Add(",");
allowedControlChars.Clear();
allowedControlChars.Add((char)Keys.Enter);
allowedControlChars.Add((char)Keys.Back);
allowedControlChars.Add((char)Keys.Space);
allowedControlChars.Add((char)Keys.LineFeed);
IgnoreChars = ".!?;,";
}
示例5: ApplyDragDropMethod
/// <seealso cref="ApplyDefaultDragDrop(TextBox)"/>
/// <example>
/// <code><pre>
/// this.ApplyDragDropMethod(
/// (sender,e)=>{
/// if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy;
/// },
/// (sender,e)=>{
/// if (e.Data.GetDataPresent(DataFormats.FileDrop))
/// {
/// var strFiles = (string[])e.Data.GetData(DataFormats.FileDrop);
/// var file = new FileInfo(strFiles[0]);
/// strFiles = null;
/// Gogo(file);
/// }
/// });</pre></code>
/// </example>
public static void ApplyDragDropMethod(this Control tInput, DragEventHandler TInputDragEnter, DragEventHandler TInputDragDrop)
{
// dragdrop
tInput.AllowDrop = true;
tInput.DragEnter += TInputDragEnter;
tInput.DragDrop += TInputDragDrop;
}
示例6: DashGlobal
public DashGlobal(
EventHandler<TextChangedEventArgs> textAreaTextChanged,
EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
KeyEventHandler textAreaKeyUp,
EventHandler textAreaSelectionChangedDelayed,
DragEventHandler textAreaDragDrop,
DragEventHandler textAreaDragEnter,
TabControl mainTabControl,
AutocompleteMenu armaSense,
Main mainWindow)
{
EditorHelper = new EditorHelper(
textAreaTextChanged,
textAreaTextChangedDelayed,
textAreaKeyUp,
textAreaSelectionChangedDelayed,
textAreaDragDrop,
textAreaDragEnter,
mainTabControl,
armaSense,
this);
TabsHelper = new TabsHelper(
textAreaTextChanged,
textAreaSelectionChangedDelayed,
mainTabControl,
this);
FilesHelper = new FilesHelper(this);
SettingsHelper = new SettingsHelper();
MainWindow = mainWindow;
}
示例7: Form1
public Form1()
{
InitializeComponent();
AllowDrop = true;
DragEnter += new DragEventHandler(Form1_DragEnter);
DragDrop += new DragEventHandler(Form1_DragDrop);
}
示例8: DocumentTreeView
public DocumentTreeView()
{
try
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DocumentTreeView));
// get image for tree
ImageList = new ImageList();
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(GetType());
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("CLSDFOLD"))); // 0
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("OPENFOLD"))); // 1
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("COMPONENT"))); // 2
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DOC"))); // 3
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DXF"))); // 4
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("PDF"))); // 5
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("STARTPAGE"))); // 6
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DOWNLOAD"))); // 7
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("AI"))); // 8
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("IMAGE"))); // 9
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSWORD"))); // 10
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSEXCEL"))); // 11
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSPPT"))); // 12
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("WRITER"))); // 13
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("CALC"))); // 14
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("ARD"))); // 15
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("ROOT"))); // 16
ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("PICADOR3D"))); // 17
// events
AfterExpand += new TreeViewEventHandler(DocumentTreeView_AfterExpand);
AfterSelect += new TreeViewEventHandler(DocumentTreeView_AfterSelect);
MouseDown += new MouseEventHandler(DocumentTreeView_MouseDown);
this.AllowDrop = true;
ItemDrag += new ItemDragEventHandler(DocumentTreeView_ItemDrag);
DragEnter += new DragEventHandler(DocumentTreeView_DragEnter);
DragOver += new DragEventHandler(DocumentTreeView_DragOver);
DragDrop += new DragEventHandler(DocumentTreeView_DragDrop);
NodeDropped += new NodeDroppedHandler(DocumentTreeView_NodeDropped);
// show tool tips
ShowNodeToolTips = true;
// allow drag and drop
AllowDrop = true;
}
catch (Pic.DAL.SQLite.ExceptionDAL ex)
{
Debug.Fail(ex.ToString());
_log.Debug(ex.ToString());
}
catch (Exception ex)
{
Debug.Fail(ex.ToString());
_log.Debug(ex.ToString());
}
}
示例9: PuzzleControl
public PuzzleControl()
{
InitializeComponent();
IsMain = false;
rctTarget.Visibility = Visibility.Hidden;
DataContextChanged += new DependencyPropertyChangedEventHandler(PuzzleControl_DataContextChanged);
PreviewDragOver += new DragEventHandler(PuzzleControl_PreviewDragOver);
PreviewDragLeave += new DragEventHandler(PuzzleControl_PreviewDragLeave);
PreviewDrop += new DragEventHandler(PuzzleControl_PreviewDrop);
}
示例10: MainWindow
public MainWindow()
{
InitializeComponent();
// inform the app that we're ready to load files pass in command line
App._manualResetEvent.Set();
// handle file drops
Drop += new DragEventHandler( FileDrop );
}
示例11: SETextBox
public SETextBox()
{
AllowDrop = true;
DragEnter += new DragEventHandler(SETextBox_DragEnter);
// DragOver += new DragEventHandler(SETextBox_DragOver); could draw some gfx where drop position is...
DragDrop += new DragEventHandler(SETextBox_DragDrop);
MouseDown += new MouseEventHandler(SETextBox_MouseDown);
MouseUp += new MouseEventHandler(SETextBox_MouseUp);
KeyDown += SETextBox_KeyDown;
}
示例12: ListViewDragAndDrop
public ListViewDragAndDrop()
{
DragAndDropEnabled = true;
IsUpdating = false;
DoubleBuffered = true;
OwnerDraw = true;
DragOver += new DragEventHandler(ListViewDragAndDrop_DragOver);
_tmrLvScroll = new Timer();
_tmrLvScroll.Tick += new EventHandler(tmrLVScroll_Tick);
}
示例13: MakeDragEventHandler
/// <summary>
/// Create a drag'n'drop event handler.
/// Windows Forms swallows unhandled exceptions during drag'n'drop, so we report them here.
/// </summary>
static DragEventHandler MakeDragEventHandler(DragEventHandler h)
{
return (sender, e) => {
try {
h(sender, e);
} catch (Exception ex) {
OnDragDropException(ex);
}
};
}
示例14: PathBrowser
public PathBrowser()
{
InitializeComponent();
Load += new EventHandler(PathBrowser_Load);
GotFocus += new EventHandler(PathBrowser_GotFocus);
bBrowse.GotFocus += new EventHandler(bBrowse_GotFocus);
Paint += new PaintEventHandler(PathBrowser_Paint);
DragDrop += new DragEventHandler(PathBrowser_DragDrop);
tPath.DragDrop += new DragEventHandler(tPath_DragDrop);
tPath.DragEnter += new DragEventHandler(tPath_DragEnter);
}
示例15: FilterTable
public FilterTable(bool dualMode, bool globalMode)
{
this.dualMode = dualMode;
this.globalMode = globalMode;
InitializeComponent();
SetupTable();
KeyDown += new KeyEventHandler(table_KeyDown);
DragDrop += new DragEventHandler(OnDragDrop);
DragEnter += new DragEventHandler(OnDragEnter);
MouseDoubleClick += new MouseEventHandler(table_MouseDoubleClick);
CellPropertyChanged += new XPTable.Events.CellEventHandler(table_CellPropertyChanged);
}