Hello Luke,
for example the code for making the childnodes:
Private Sub update_mrkparli st(ByRef prp_date_id As Integer, ByRef
mrk_num As String)
Dim paritem As ListViewEx.List ViewItem
Dim prp_par_num() As Short = Nothing
Dim prp_par_kom() As String = Nothing
Dim prp_par_val() As Single = Nothing
Dim prp_par_fmt() As String = Nothing
Dim prp_par_txt() As String = Nothing
Dim idx As Short
Dim par_node As TreeViewEx.Tree Node
Dim mkey As String = ""
Dim parTxt As String = ""
ACTION_SEND = AC_LOAD
siz_size = MAX_REC_SIZE
rec_size = 0
retval = ole2eva.w_ustmm prl(rec_size, siz_size, prp_date_id,
mrk_num, prp_par_num, prp_par_kom, prp_par_val, prp_par_fmt, prp_par_txt,
zugriff_user, ACTION_SEND, ACTION_RET)
If rec_size = MAX_REC_SIZE Then
meassage(fm_eva stamm.DefInstan ce.lv_text.GetT ext("T_message_ maxsize"))
End If
If ts_main.Selecte dTab.Name = "MPLST" Then
bring_Listbox(" MPLST", Im_EVA)
lv_main.Columns .Clear()
lv_main.Columns .Add(fm_evastam m.DefInstance.l v_text.GetText( "T_Paramete r"),
70, HorizontalAlign ment.Left)
lv_main.Columns .Add(fm_evastam m.DefInstance.l v_text.GetText( "T_Kommenta r"),
150, HorizontalAlign ment.Left)
lv_main.Columns .Add(fm_evastam m.DefInstance.l v_text.GetText( "T_Wert"), 50,
HorizontalAlign ment.Left)
lv_main.Columns .Add(fm_evastam m.DefInstance.l v_text.GetText( "T_Format") , 50,
HorizontalAlign ment.Left)
lv_main.Columns .Add(fm_evastam m.DefInstance.l v_text.GetText( "T_ParameterTex t"), 300, HorizontalAlign ment.Left)
End If
While tv_main.Selecte dNode.GetNodeCo unt(False) > 0
tv_main.Nodes.R emove((tv_main. SelectedNode.Fi rstNode))
End While
lv_main.Items.C lear()
tv_main.ImageLi st = Im_EVA
parTxt = fm_evastamm.Def Instance.lv_tex t.GetText("T_Pa rameter") & ": "
For idx = 0 To rec_size - 1
mkey = "MP" & prp_date_id & KEYSEP & mrk_num & KEYSEP &
prp_par_num(idx )
paritem = New ListViewEx.List ViewItem(mkey, 11,
CStr(prp_par_nu m(idx)))
paritem.Text = CStr(prp_par_nu m(idx))
paritem.SubItem s.Add(prp_par_k om(idx))
paritem.SubItem s.Add(to_string (prp_par_fmt(id x),
prp_par_val(idx ), idx + 1))
paritem.SubItem s.Add(prp_par_f mt(idx))
paritem.SubItem s.Add(prp_par_t xt(idx))
lv_main.Items.A dd(paritem)
par_node = New TreeViewEx.Tree Node(mkey, 11, parTxt &
prp_par_num(idx ))
par_node.Tag = prp_par_num
tv_main.Selecte dNode.Nodes.Add (par_node)
Next idx
End Sub
this is the code to making the selected node bold and the selected node
befor to normal fond
Public Sub tv_main_AfterSe lect(ByVal sender As Object, ByVal e As
System.Windows. Forms.TreeViewE ventArgs) Handles tv_main.AfterSe lect
Dim fnt As Font
Dim fnt_bold As Font
akt_node = tv_main.Selecte dNode
fnt = akt_node.NodeFo nt
fnt_bold = New Font(fnt, FontStyle.Bold)
akt_node.NodeFo nt = fnt
If Not (akt_node_befor Is Nothing) Then akt_node_befor. NodeFont = fnt
akt_node.NodeFo nt = fnt_bold
akt_node_befor = akt_node
End Sub
and hear you see the code for my extended treeview with key inside
Public Class TreeNode
Inherits System.Windows. Forms.TreeNode
Implements IDictionaryEnum erator
Private nodeEntry As DictionaryEntry
Private enumerator As IEnumerator
Public Sub New()
enumerator = MyBase.Nodes.Ge tEnumerator()
End Sub
Public Sub New(ByVal Key As String)
enumerator = MyBase.Nodes.Ge tEnumerator()
nodeEntry.Key = Key
End Sub
Public Sub New(ByVal Key As String, ByVal ImageIndex As Short, ByVal
Text As String)
enumerator = MyBase.Nodes.Ge tEnumerator()
nodeEntry.Key = Key
MyBase.Text = Text
MyBase.ImageInd ex = ImageIndex
MyBase.Selected ImageIndex = ImageIndex
MyBase.NodeFont = New Font("Microsoft Sans Serif", 8,
FontStyle.Regul ar)
End Sub
Public Property NodeKey() As String
Get
Return nodeEntry.Key.T oString()
End Get
Set(ByVal Value As String)
nodeEntry.Key = Value
End Set
End Property
Public Property NodeValue() As Object
Get
Return nodeEntry.Value
End Get
Set(ByVal Value As Object)
nodeEntry.Value = Value
End Set
End Property
Public Overridable Overloads ReadOnly Property Entry() As
DictionaryEntry _
Implements IDictionaryEnum erator.Entry
Get
Return nodeEntry
End Get
End Property
Public Overridable Overloads Function MoveNext() As Boolean _
Implements IDictionaryEnum erator.MoveNext
Dim Success As Boolean
Success = enumerator.Move Next()
Return Success
End Function
Public Overridable Overloads ReadOnly Property Current() As Object _
Implements IEnumerator.Cur rent
Get
Return enumerator.Curr ent
End Get
End Property
Public Overridable Overloads ReadOnly Property Key() As Object _
Implements IDictionaryEnum erator.Key
Get
Return nodeEntry.Key
End Get
End Property
Public Overridable Overloads ReadOnly Property Value() As Object _
Implements IDictionaryEnum erator.Value
Get
Return nodeEntry.Value
End Get
End Property
Public Overridable Overloads Sub Reset() _
Implements IEnumerator.Res et
enumerator.Rese t()
End Sub
End Class
I hobe this will help you to help me.
Best regards
Manfred Loeffler
"Luke Zhang [MSFT]" wrote:
Hello,
Can you provide some source code you are currently working with? With them,
we may reproduce the issue and see what happen there.
Thanks,
Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)