Click here to Skip to main content
16,005,316 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VBA/Excel - Execute macro if comment inserted Pin
Jon G23-Jun-04 6:33
Jon G23-Jun-04 6:33 
GeneralRe: VBA/Excel - Execute macro if comment inserted Pin
Mike Ellison23-Jun-04 6:56
Mike Ellison23-Jun-04 6:56 
GeneralNew Problem Pin
MarcMicalizzi23-Jun-04 5:08
MarcMicalizzi23-Jun-04 5:08 
GeneralRe: New Problem Pin
Dave Kreskowiak23-Jun-04 5:50
mveDave Kreskowiak23-Jun-04 5:50 
GeneralRe: New Problem Pin
Steven Campbell23-Jun-04 7:27
Steven Campbell23-Jun-04 7:27 
GeneralRe: New Problem Pin
Dave Kreskowiak23-Jun-04 8:37
mveDave Kreskowiak23-Jun-04 8:37 
GeneralDrag and drop between 2 listboxes Pin
Member 62023523-Jun-04 3:26
Member 62023523-Jun-04 3:26 
GeneralDrag and drop between 2 listboxes Pin
Member 62023523-Jun-04 3:26
Member 62023523-Jun-04 3:26 
Cry | :(( im trying to drag staff member names from lstAvailableStaff to lstCurrentJobStaff. For some or other reason it keeps on dragging the same name everytime.A speedy reply would be most appreciated.

Here is the code:

Public Class frmAssignStaff
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents lstAvailableStaff As System.Windows.Forms.ListBox
Friend WithEvents grpAvailableStaff As System.Windows.Forms.GroupBox
Friend WithEvents grpCurrentJobStaff As System.Windows.Forms.GroupBox
Friend WithEvents lstCurrentJobStaff As System.Windows.Forms.ListBox
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents btnRemove As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.lstAvailableStaff = New System.Windows.Forms.ListBox
Me.grpAvailableStaff = New System.Windows.Forms.GroupBox
Me.grpCurrentJobStaff = New System.Windows.Forms.GroupBox
Me.lstCurrentJobStaff = New System.Windows.Forms.ListBox
Me.btnSave = New System.Windows.Forms.Button
Me.btnCancel = New System.Windows.Forms.Button
Me.btnAdd = New System.Windows.Forms.Button
Me.btnRemove = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.grpAvailableStaff.SuspendLayout()
Me.grpCurrentJobStaff.SuspendLayout()
Me.SuspendLayout()
'
'lstAvailableStaff
'
Me.lstAvailableStaff.Items.AddRange(New Object() {"Falicia", "Ferzhana", "Asheeqah", "Kathryn", "!!JonnoMan!!"})
Me.lstAvailableStaff.Location = New System.Drawing.Point(16, 24)
Me.lstAvailableStaff.Name = "lstAvailableStaff"
Me.lstAvailableStaff.Size = New System.Drawing.Size(264, 368)
Me.lstAvailableStaff.TabIndex = 0
'
'grpAvailableStaff
'
Me.grpAvailableStaff.Controls.Add(Me.lstAvailableStaff)
Me.grpAvailableStaff.Location = New System.Drawing.Point(8, 8)
Me.grpAvailableStaff.Name = "grpAvailableStaff"
Me.grpAvailableStaff.Size = New System.Drawing.Size(296, 400)
Me.grpAvailableStaff.TabIndex = 1
Me.grpAvailableStaff.TabStop = False
Me.grpAvailableStaff.Text = "Available Staff"
'
'grpCurrentJobStaff
'
Me.grpCurrentJobStaff.Controls.Add(Me.lstCurrentJobStaff)
Me.grpCurrentJobStaff.Location = New System.Drawing.Point(384, 8)
Me.grpCurrentJobStaff.Name = "grpCurrentJobStaff"
Me.grpCurrentJobStaff.Size = New System.Drawing.Size(288, 400)
Me.grpCurrentJobStaff.TabIndex = 2
Me.grpCurrentJobStaff.TabStop = False
Me.grpCurrentJobStaff.Text = "Current Job Staff"
'
'lstCurrentJobStaff
'
Me.lstCurrentJobStaff.AllowDrop = True
Me.lstCurrentJobStaff.Location = New System.Drawing.Point(16, 24)
Me.lstCurrentJobStaff.Name = "lstCurrentJobStaff"
Me.lstCurrentJobStaff.Size = New System.Drawing.Size(264, 368)
Me.lstCurrentJobStaff.TabIndex = 0
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(229, 424)
Me.btnSave.Name = "btnSave"
Me.btnSave.TabIndex = 3
Me.btnSave.Text = "&Save"
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(384, 424)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "&Cancel"
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(312, 176)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(64, 23)
Me.btnAdd.TabIndex = 5
Me.btnAdd.Text = ">>"
'
'btnRemove
'
Me.btnRemove.Location = New System.Drawing.Point(312, 216)
Me.btnRemove.Name = "btnRemove"
Me.btnRemove.Size = New System.Drawing.Size(64, 23)
Me.btnRemove.TabIndex = 6
Me.btnRemove.Text = "<<"
Me.btnRemove.Visible = False
'
'TextBox1
'
Me.TextBox1.AllowDrop = True
Me.TextBox1.Location = New System.Drawing.Point(104, 424)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 7
Me.TextBox1.Text = "TextBox1"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(16, 424)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 8
Me.Button1.Text = "Button1"
'
'frmAssignStaff
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(688, 470)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.btnRemove)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.grpCurrentJobStaff)
Me.Controls.Add(Me.grpAvailableStaff)
Me.Name = "frmAssignStaff"
Me.Text = "frmAssignStaff"
Me.grpAvailableStaff.ResumeLayout(False)
Me.grpCurrentJobStaff.ResumeLayout(False)
Me.ResumeLayout(False)

End Sub

#End Region


Dim selectedStaffMember As String

Private Sub lstAvailableStaff_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstAvailableStaff.MouseDown
selectedStaffMember = lstAvailableStaff.SelectedItem
lstAvailableStaff.DoDragDrop(selectedStaffMember, DragDropEffects.Copy Or DragDropEffects.Move)

End Sub






Private Sub lstCurrentJobStaff_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragDrop
Dim test As String
'''***Cant get e.data.....to change value!!!
test = e.Data.GetData(DataFormats.Text).ToString

lstCurrentJobStaff.Items.Add(test)




End Sub

Private Sub frmAssignStaff_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lstCurrentJobStaff.AllowDrop = True
End Sub

Private Sub lstCurrentJobStaff_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
btnRemove.Visible = True
End Sub






End Class



Plz help a poor student
Generalinterfacing scanner Pin
Saud AKhter22-Jun-04 23:37
Saud AKhter22-Jun-04 23:37 
GeneralRe: interfacing scanner Pin
Dave Kreskowiak23-Jun-04 3:36
mveDave Kreskowiak23-Jun-04 3:36 
GeneralVB6 to .Net User Controls Pin
mckly22-Jun-04 22:09
mckly22-Jun-04 22:09 
GeneralRe: VB6 to .Net User Controls Pin
Dave Kreskowiak23-Jun-04 3:30
mveDave Kreskowiak23-Jun-04 3:30 
GeneralFiles per folder in Windows 2000 Pin
steff kamush22-Jun-04 20:07
steff kamush22-Jun-04 20:07 
GeneralRe: Files per folder in Windows 2000 Pin
Dave Kreskowiak23-Jun-04 3:19
mveDave Kreskowiak23-Jun-04 3:19 
GeneralControl Arrays Pin
TimKiwi22-Jun-04 18:44
TimKiwi22-Jun-04 18:44 
GeneralRe: Control Arrays Pin
Dave Kreskowiak23-Jun-04 3:08
mveDave Kreskowiak23-Jun-04 3:08 
GeneralRe: Control Arrays Pin
TimKiwi23-Jun-04 16:11
TimKiwi23-Jun-04 16:11 
GeneralRe: Control Arrays Pin
Dave Kreskowiak24-Jun-04 4:57
mveDave Kreskowiak24-Jun-04 4:57 
Generalerror in sending mail Pin
Anonymous22-Jun-04 18:31
Anonymous22-Jun-04 18:31 
GeneralRe: error in sending mail Pin
Dave Kreskowiak23-Jun-04 2:59
mveDave Kreskowiak23-Jun-04 2:59 
Generalsend mail Pin
sondos22-Jun-04 18:07
sondos22-Jun-04 18:07 
Generalsend mail Pin
sondos22-Jun-04 18:07
sondos22-Jun-04 18:07 
GeneralRe: send mail Pin
bneacetp22-Jun-04 18:20
bneacetp22-Jun-04 18:20 
GeneralI need a coder Pin
BadgeHelp22-Jun-04 12:50
BadgeHelp22-Jun-04 12:50 
GeneralRe: I need a coder Pin
Colin Angus Mackay22-Jun-04 12:59
Colin Angus Mackay22-Jun-04 12: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.