Bosna i Hercegovina



#1 22.06.2018-13:28
xl_kid Offline
Clan
Registrovan/a od: 11.11.2008-08:24
Komentari: 109


Subject: Failed to load toolbox item
Imam klasu "CustomDataGridView" koju pokušavam da ubacim u projekt ali mi stalno javlja grešku "failed to load toolbox item". Goglao sam, pokušavao i ništa. Disappointed Na prethodnom projektu je radilo. CustomDataGridView je naslednica DataGrid-a i tako sam rešio problem entera u DataGrid-u.

Molim za pomoć Smiling
↑  ↓

#2 22.06.2018-18:23
Gjoreski Offline
Super Moderator
Registrovan/a od: 02.02.2009-22:24
Komentari: 1,548


Subject: Re: Failed to load toolbox item
Ja ne raazumem tvoj problem. Sta treba raditi ta klasa?
↑  ↓

#3 22.06.2018-22:07
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,842


Subject: Re: Failed to load toolbox item
Kopirao si klas modul pretpostavljam.
E sad mozda nedostaje jos nesto vjerovatno.
Zakci primjer pa cemo rijesiti.
Pozdrav
↑  ↓

#4 25.06.2018-06:13
xl_kid Offline
Clan
Registrovan/a od: 11.11.2008-08:24
Komentari: 109


Subject: Re: Failed to load toolbox item
Klasa je za enter u DataGrid-u (enter umesto tab).

evo i koda
Public Class CustomDataGridView

Inherits DataGridView

Private _EnterMovesToNextCell As Boolean = True
<System.ComponentModel.DefaultValue(GetType(Boolean), "True")>
Public Property EnterMovesToNextCell() As Boolean
Get
Return _EnterMovesToNextCell
End Get
Set(ByVal value As Boolean)
_EnterMovesToNextCell = value
End Set
End Property 'EnterMovesToNextCell

Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
' handles key while in edit
Select Case (keyData And Keys.KeyCode)
Case Keys.Enter
If Me._EnterMovesToNextCell AndAlso (keyData And Keys.Modifiers) = Keys.None Then
myProcessTabKey(Keys.Tab)
Return True
End If
Case Keys.Tab
If Me.StandardTab Then
If (keyData And Keys.Modifiers) = Keys.Control Then
myProcessTabKey(keyData)
Return True
End If
Else
If (keyData And Keys.Modifiers) = Keys.None OrElse (keyData And Keys.Modifiers) = Keys.Shift Then
myProcessTabKey(keyData)
Return True
End If
End If
End Select
Return MyBase.ProcessDialogKey(keyData)
End Function 'ProcessDialogKey

Protected Overrides Function ProcessDataGridViewKey(ByVal e As System.Windows.Forms.KeyEventArgs) As Boolean
If Me._EnterMovesToNextCell AndAlso e.KeyCode = Keys.Enter Then
Return myProcessTabKey(e.KeyData)
End If
If Me.StandardTab Then
If e.Control AndAlso e.KeyCode = Keys.Tab Then
Return myProcessTabKey(e.KeyData)
Else
Return MyBase.ProcessDataGridViewKey(e)
End If
Else
If e.KeyCode = Keys.Tab Then
Return myProcessTabKey(e.KeyData)
Else
Return MyBase.ProcessDataGridViewKey(e)
End If
End If
End Function ' ProcessDataGridViewKey

Private Function myProcessTabKey(ByVal keyData As Keys) As Boolean
' return True if key processed
If ((keyData And Keys.Shift) = Keys.Shift) Then
Return Me.TabToPreviousCell
Else
Return Me.TabToNextCell
End If
End Function ' myProcessTabKey

Private Function TabToPreviousCell() As Boolean
Dim firstCol As DataGridViewColumn = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If firstCol Is Nothing Then ' no selectable columns
Return False
End If

Dim prevCol As DataGridViewColumn = Columns.GetPreviousColumn(Columns(CurrentCell.ColumnIndex), DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If prevCol Is Nothing Then
'see if we can go to the previous row, lastcol
Dim rowIndex As Integer = Rows.GetPreviousRow(Me.CurrentCellAddress.Y, DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If rowIndex <> -1 Then
SetCell(Me.Columns.GetLastColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly).Index, rowIndex)
Return True
Else
Return False
End If ' rowIndex <> -1
Else
SetCell(prevCol.Index, Me.CurrentCellAddress.Y)
Return True
End If ' prevCol Is Nothing
End Function ' TabToPreviousCell

Private Function TabToNextCell() As Boolean
Dim firstCol As DataGridViewColumn = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If firstCol Is Nothing Then ' no selectable columns
Return False
End If

Dim nextCol As DataGridViewColumn = Columns.GetNextColumn(Columns(Me.CurrentCellAddress.X), DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If nextCol Is Nothing Then
' check if can go to next row firstcol
Dim rowIndex As Integer = Rows.GetNextRow(Me.CurrentCellAddress.Y, DataGridViewElementStates.Visible, DataGridViewElementStates.ReadOnly)
If rowIndex > Me.CurrentCellAddress.Y Then
Me.SetCell(firstCol.Index, rowIndex)
Return True
Else
Return False
End If ' rowIndex > Me.CurrentCellAddress.Y
Else
Me.SetCell(nextCol.Index, Me.CurrentCellAddress.Y)
Return True
End If ' nextCol Is Nothing
End Function ' TabToNextCell

Private Sub SetCell(ByVal colIndex As Int32, ByVal rowIndex As Int32)
Me.ClearSelection()
Me.SetSelectedCellCore(colIndex, rowIndex, True)
Me.SetCurrentCellAddressCore(colIndex, rowIndex, True, False, False)
End Sub ' SetCell
End Class ' CustomGridViewSkipReadOnly
↑  ↓

#5 25.06.2018-16:28
Gjoreski Offline
Super Moderator
Registrovan/a od: 02.02.2009-22:24
Komentari: 1,548


Subject: Re: Failed to load toolbox item
Ja ovde ne vidim nikakva klasa ovo su par funkcije ali klasu ne vidim.
↑  ↓

#6 25.06.2018-18:27
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,842


Subject: Re: Failed to load toolbox item
Ovo je vbnet samo neznam koja verzija.
Klasa grida.
Kod mene nece da odradi posao.
U kojoj verziji vb-a je ovo radilo.
Pozdrav
↑  ↓

#7 25.06.2018-18:57
Gjoreski Offline
Super Moderator
Registrovan/a od: 02.02.2009-22:24
Komentari: 1,548


Subject: Re: Failed to load toolbox item
Ovo je najverojatno 2017 , ili 2018
↑  ↓

#8 26.06.2018-11:44
xl_kid Offline
Clan
Registrovan/a od: 11.11.2008-08:24
Komentari: 109


Subject: Re: Failed to load toolbox item
Visual Studio 2017
↑  ↓

#9 26.06.2018-11:55
xl_kid Offline
Clan
Registrovan/a od: 11.11.2008-08:24
Komentari: 109


Subject: Re: Failed to load toolbox item
u prethodnom projektu je radilo ok. ista verzija isto sve. sada kada pokušam da ga uvezem javlja gore opisanu grešku.
↑  ↓

#10 27.06.2018-13:32
Gjoreski Offline
Super Moderator
Registrovan/a od: 02.02.2009-22:24
Komentari: 1,548


Subject: Re: Failed to load toolbox item
Nemam vb2017 ne mogu isprobati
↑  ↓

#11 27.06.2018-20:21
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,842


Subject: Re: Failed to load toolbox item
Javlja ti gresku zato sto ga nemas u talboxu.
Trebas ha ucitati.
Pozdrav
↑  ↓

#12 28.06.2018-12:31
xl_kid Offline
Clan
Registrovan/a od: 11.11.2008-08:24
Komentari: 109


Subject: Re: Failed to load toolbox item
To mi i jeste problem. Ne mogu ga učitati u toolbox-u. Kako da rešim taj problem tj kako da ga učitam?
↑  ↓

#13 28.06.2018-17:50
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,842


Subject: Re: Failed to load toolbox item
Hoces reci da ti data grid kontrolu nemozes ucitati u talboxu niti je postaviti na formu.
ako je tako to nema beze sa ovim kodom.
Moras vidjeti sta ti je sa data gridom.
U stvari moras prvo da nam ucitas pravi naziv i putanju data grida u talboxu.
Pozdrav
↑  ↓

#14 04.07.2018-13:06
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,842


Subject: Re: Failed to load toolbox item
Sta bi sa ovim?
Pozdrav
↑  ↓

Stranice (1): 1

All times are GMT +01:00. Current time: 18.12.2018-14:56.