Click here to Skip to main content
15,923,576 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUsing Internet Explorer Controls from VB6 Pin
Rajg_136-Nov-06 20:58
Rajg_136-Nov-06 20:58 
QuestionAccess Internet connection infomation via declares [modified] Pin
Farmer bob6-Nov-06 17:55
Farmer bob6-Nov-06 17:55 
QuestionVNC Implementation in VB.NET Pin
Brandon X.6-Nov-06 16:12
Brandon X.6-Nov-06 16:12 
AnswerRe: VNC Implementation in VB.NET Pin
Yona Low7-Nov-06 4:25
Yona Low7-Nov-06 4:25 
QuestionDataGrid Pin
andy386-Nov-06 12:53
andy386-Nov-06 12:53 
AnswerRe: DataGrid Pin
nlarson117-Nov-06 3:46
nlarson117-Nov-06 3:46 
QuestionRun... Pin
Code Crapper6-Nov-06 12:44
Code Crapper6-Nov-06 12:44 
QuestionVS2003. Copy and Paste row/s within DataGrid Pin
EvoFreak6-Nov-06 12:07
EvoFreak6-Nov-06 12:07 
Hi,

I have got this issue where I need to copy/paste multiple rows. At the moment, copying and pasting a single row seems possible. And it seems to work. copying and pasting multiple rows seems to be the problem. Only the last row that was highlighted to be copied seems to be entered within ClipBoard.

Here is my code:
Try
            If e.KeyCode = Keys.C Then
                'copy key c is pressed
                Dim counter As Integer = 0
                Dim selectedItemsArrayList As New ArrayList
                For Each r As DataStructure.ItemsRow In MainForm.Data.Items
                    If dg.IsSelected(counter) Then
                        selectedItemsArrayList.Add(counter)
                    End If
                    counter += 1
                Next
                Dim format As DataFormats.Format = DataFormats.GetFormat(Me.ToString)
                Dim data As IDataObject = New DataObject
                Dim row As DataRow
                If selectedItemsArrayList.Count > 0 Then
                    'if count is greater than 0, there are some rows selected
                    For Each i As Integer In selectedItemsArrayList
                        'for each row that is selected to be added
                        'add to clipboard
                        selectedDataGridRow = selectedItemsArrayList(i)
                        row = MainForm.Data.Items(selectedItemsArrayList(i))
                        data.SetData(format.Name, False, row.ItemArray)
                        Clipboard.SetDataObject(data, False)
                    Next
                End If
            End If
            If e.KeyCode = Keys.V Then
                'paste key is pressed
                Dim row As Object()
                Dim ClipData As IDataObject = Clipboard.GetDataObject
                Dim format As String = Me.ToString
                If ClipData.GetDataPresent(format) Then
                    row = CType(ClipData.GetData(format), Object())
                    'add row to datagrid
                    MainForm.Data.Items.Rows.Add(row)
                End If
            End If
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try


I guess I need to either modify the way I add items into ClipBoard or modify the way I retrieve items from within ClipBoard.

Cheers

---------------------------------
There is life outside coding.

AnswerRe: VS2003. Copy and Paste row/s within DataGrid Pin
nlarson117-Nov-06 4:00
nlarson117-Nov-06 4:00 
QuestionetCreating a Deployment package Pin
dgibson55316-Nov-06 9:24
dgibson55316-Nov-06 9:24 
AnswerRe: etCreating a Deployment package Pin
UltraCoder6-Nov-06 10:01
UltraCoder6-Nov-06 10:01 
QuestionIs It Possible Pin
UltraCoder6-Nov-06 9:14
UltraCoder6-Nov-06 9:14 
AnswerRe: Is It Possible Pin
Captain See Sharp6-Nov-06 16:39
Captain See Sharp6-Nov-06 16:39 
GeneralRe: Is It Possible Pin
UltraCoder6-Nov-06 16:49
UltraCoder6-Nov-06 16:49 
GeneralRe: Is It Possible Pin
Captain See Sharp6-Nov-06 17:15
Captain See Sharp6-Nov-06 17:15 
QuestionTimer out of control! Pin
Code Crapper6-Nov-06 8:36
Code Crapper6-Nov-06 8:36 
AnswerRe: Timer out of control! Pin
UltraCoder6-Nov-06 9:12
UltraCoder6-Nov-06 9:12 
QuestionRe: Timer out of control! Pin
Code Crapper6-Nov-06 9:34
Code Crapper6-Nov-06 9:34 
AnswerRe: Timer out of control! Pin
Guffa6-Nov-06 9:48
Guffa6-Nov-06 9:48 
GeneralRe: Timer out of control! Pin
Code Crapper6-Nov-06 9:53
Code Crapper6-Nov-06 9:53 
GeneralRe: Timer out of control! Pin
UltraCoder6-Nov-06 9:56
UltraCoder6-Nov-06 9:56 
GeneralRe: Timer out of control! Pin
Code Crapper6-Nov-06 9:59
Code Crapper6-Nov-06 9:59 
AnswerRe: Timer out of control! Pin
Guffa6-Nov-06 10:05
Guffa6-Nov-06 10:05 
GeneralRe: Timer out of control! Pin
Code Crapper6-Nov-06 10:07
Code Crapper6-Nov-06 10:07 
Questionformat cost Pin
jds12076-Nov-06 8:03
jds12076-Nov-06 8:03 

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.