473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

TreeNode in bold clips the label also if Treeview Fond is bold

When settiing a TreeNode to bold the text label of that node is clipped. As
describedin in the Bug Rebort FDBK16963 I set the underliying TreeView Fond
to be bold.

Now I have the strange behavior, if I delete all childnodes, when the parent
node is expanted, and rebuild all child treenodes, I can make an childnode
bold without clipping it. If I make the same with an closed parent node so
after rebulding all childnodes and expanting it, all child nodes will be
clipped if makeing them bold
Feb 9 '06 #1
11 4715
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.)

Feb 10 '06 #2
Hello Luke,

for example the code for making the childnodes:

Private Sub update_mrkparlist(ByRef prp_date_id As Integer, ByRef
mrk_num As String)
Dim paritem As ListViewEx.ListViewItem
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.TreeNode
Dim mkey As String = ""
Dim parTxt As String = ""

ACTION_SEND = AC_LOAD
siz_size = MAX_REC_SIZE
rec_size = 0
retval = ole2eva.w_ustmmprl(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_evastamm.DefInstance.lv_text.GetText(" T_message_maxsize"))
End If

If ts_main.SelectedTab.Name = "MPLST" Then
bring_Listbox("MPLST", Im_EVA)
lv_main.Columns.Clear()

lv_main.Columns.Add(fm_evastamm.DefInstance.lv_tex t.GetText("T_Parameter"),
70, HorizontalAlignment.Left)

lv_main.Columns.Add(fm_evastamm.DefInstance.lv_tex t.GetText("T_Kommentar"),
150, HorizontalAlignment.Left)

lv_main.Columns.Add(fm_evastamm.DefInstance.lv_tex t.GetText("T_Wert"), 50,
HorizontalAlignment.Left)

lv_main.Columns.Add(fm_evastamm.DefInstance.lv_tex t.GetText("T_Format"), 50,
HorizontalAlignment.Left)

lv_main.Columns.Add(fm_evastamm.DefInstance.lv_tex t.GetText("T_ParameterText"), 300, HorizontalAlignment.Left)
End If

While tv_main.SelectedNode.GetNodeCount(False) > 0
tv_main.Nodes.Remove((tv_main.SelectedNode.FirstNo de))
End While
lv_main.Items.Clear()
tv_main.ImageList = Im_EVA
parTxt = fm_evastamm.DefInstance.lv_text.GetText("T_Paramet er") & ": "
For idx = 0 To rec_size - 1
mkey = "MP" & prp_date_id & KEYSEP & mrk_num & KEYSEP &
prp_par_num(idx)
paritem = New ListViewEx.ListViewItem(mkey, 11,
CStr(prp_par_num(idx)))
paritem.Text = CStr(prp_par_num(idx))
paritem.SubItems.Add(prp_par_kom(idx))
paritem.SubItems.Add(to_string(prp_par_fmt(idx),
prp_par_val(idx), idx + 1))
paritem.SubItems.Add(prp_par_fmt(idx))
paritem.SubItems.Add(prp_par_txt(idx))
lv_main.Items.Add(paritem)
par_node = New TreeViewEx.TreeNode(mkey, 11, parTxt &
prp_par_num(idx))
par_node.Tag = prp_par_num
tv_main.SelectedNode.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_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles tv_main.AfterSelect

Dim fnt As Font
Dim fnt_bold As Font

akt_node = tv_main.SelectedNode
fnt = akt_node.NodeFont
fnt_bold = New Font(fnt, FontStyle.Bold)
akt_node.NodeFont = fnt
If Not (akt_node_befor Is Nothing) Then akt_node_befor.NodeFont = fnt
akt_node.NodeFont = 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 IDictionaryEnumerator

Private nodeEntry As DictionaryEntry
Private enumerator As IEnumerator

Public Sub New()
enumerator = MyBase.Nodes.GetEnumerator()
End Sub
Public Sub New(ByVal Key As String)
enumerator = MyBase.Nodes.GetEnumerator()
nodeEntry.Key = Key
End Sub
Public Sub New(ByVal Key As String, ByVal ImageIndex As Short, ByVal
Text As String)
enumerator = MyBase.Nodes.GetEnumerator()
nodeEntry.Key = Key
MyBase.Text = Text
MyBase.ImageIndex = ImageIndex
MyBase.SelectedImageIndex = ImageIndex
MyBase.NodeFont = New Font("Microsoft Sans Serif", 8,
FontStyle.Regular)
End Sub
Public Property NodeKey() As String
Get
Return nodeEntry.Key.ToString()
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 IDictionaryEnumerator.Entry

Get
Return nodeEntry
End Get
End Property
Public Overridable Overloads Function MoveNext() As Boolean _
Implements IDictionaryEnumerator.MoveNext

Dim Success As Boolean

Success = enumerator.MoveNext()
Return Success
End Function
Public Overridable Overloads ReadOnly Property Current() As Object _
Implements IEnumerator.Current

Get
Return enumerator.Current
End Get
End Property
Public Overridable Overloads ReadOnly Property Key() As Object _
Implements IDictionaryEnumerator.Key

Get
Return nodeEntry.Key
End Get
End Property

Public Overridable Overloads ReadOnly Property Value() As Object _
Implements IDictionaryEnumerator.Value

Get
Return nodeEntry.Value
End Get
End Property

Public Overridable Overloads Sub Reset() _
Implements IEnumerator.Reset

enumerator.Reset()
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.)

Feb 10 '06 #3
Hello,

Thank you for the code, however, there is still some parts not clear. I
cannot find How you deifne "akt_node" and "akt_node_befor"? Also, could you
please tell the exact link for "Bug Rebort FDBK16963" mentioned in your
first message?

Thanks,

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 13 '06 #4
Hello Luke,

hear is the link to the bug report

http://lab.msdn.microsoft.com/produc...ckid=FDBK16963

and both node where declared as

Dim akt_node As TreeViewEx.TreeNode
Dim akt_node_befor As TreeViewEx.TreeNode

best regards,

Manfred Löffler
"Luke Zhang [MSFT]" wrote:
Hello,

Thank you for the code, however, there is still some parts not clear. I
cannot find How you deifne "akt_node" and "akt_node_befor"? Also, could you
please tell the exact link for "Bug Rebort FDBK16963" mentioned in your
first message?

Thanks,

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 13 '06 #5
Thank you for the information. I can now run a sample application with your
code. But strange enough, I couldn't found the issue you mentioned the
thild node will always clipped if its font is bold. For example, I select a
parent node, and then click a button, running some code to remove its child
nodes and re-add them. But the child nodes always clipped when I selected
them.

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 14 '06 #6
Can you send me an email adress where I can send you some screenshots of the
behavour of the treeview with the necassery action to reproduce the error

Manfred Löffler

"Luke Zhang [MSFT]" wrote:
Thank you for the information. I can now run a sample application with your
code. But strange enough, I couldn't found the issue you mentioned the
thild node will always clipped if its font is bold. For example, I select a
parent node, and then click a button, running some code to remove its child
nodes and re-add them. But the child nodes always clipped when I selected
them.

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 14 '06 #7
Please remove "online" to get my actual email. And, how many items did you
add to the parent node?

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 15 '06 #8
Hello Luke,

I have make some screenshots with the strange behaviour and send it to you
by mail.

I hope this will help you.

so long,

Manfred Löffler

"Luke Zhang [MSFT]" wrote:
Please remove "online" to get my actual email. And, how many items did you
add to the parent node?

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 15 '06 #9
Thank you for the inforamtion. I have got your message and seen the screen
shot. However, I still cannot repro on my side. I suspect it may be related
the nodes we added in the treeview control.

Anyway, I double if we should call this a bug. The "Clipped" node text is a
known bug, and the "unclipped" text is right behavior as we expect. So, if
we get the "unclipped" with some precondition, shall we call it a bug?

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 16 '06 #10
Yes I thing it is a bug because the behaviour is completlie differnt to the
former version of Framework 1.1 and my custumers can not accept an clipped
treenode. I make now the selected treeview in a different color and waiting
of the bugfix which correct the problem with the bold treenode.

Manfred Löffler

"Luke Zhang [MSFT]" wrote:
Thank you for the inforamtion. I have got your message and seen the screen
shot. However, I still cannot repro on my side. I suspect it may be related
the nodes we added in the treeview control.

Anyway, I double if we should call this a bug. The "Clipped" node text is a
known bug, and the "unclipped" text is right behavior as we expect. So, if
we get the "unclipped" with some precondition, shall we call it a bug?

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 16 '06 #11
By further researching on the bug, I found it is related to the comctl
control shipped with Windows and IE. The bad news is, we cannot expect it
will be fixed in a short time since it is not a completed .NET issue.

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 17 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sean | last post by:
Hi, I have a treeview and user can right click the treenodes, depending on the nodes, different shortcut menu will appear. I want only the shortcut menu to appear if the point of the right...
2
by: Fei Li | last post by:
Why TreeNode is a string? It should hold a Object and get label from Object.ToString(). Then much better. Easy to trace all objects in a TreeView.
1
by: MrNobody | last post by:
I was wondering if it was at all possible to make the label of a TreeNode dynamic- calling a specific method or property whenever it needs to obtain a label to draw? The reason is I'd like to...
3
by: markaelkins | last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am basically trying to send an ID variable into sql to return different records. I've searched everywhere and cannot find the...
10
by: Juan Romero | last post by:
Hey guys, I have been playing with different fonts for the nodes of a treeview. When I change the font to bigger sizes, the text area of the treenode (label) no longer displays all the text. I...
4
by: pamelafluente | last post by:
Hi I noticed that if I use a bold font for 1 TreeNode of a TreeView several times the string does not fit anymore and gets truncated. How can I avoid that ? Any suggestionis appreciated ...
9
by: vincent90152900 | last post by:
How to pop up different text base on the selected TreeNode? I want to pop up different Text base on the selected TreeNode of the TreeView component. So, I create a TreeView and a ModalPopupExtender....
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
4
by: ohad weiss | last post by:
Hi all I have a question abount renaming a selected treenode. My user can place the cursor on a treeview, click on the right button of the mouse, and a contextmenue is beeing populated, in which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.