473,624 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4747
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_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.)

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.Tree Node
Dim akt_node_befor As TreeViewEx.Tree Node

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

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

Similar topics

2
6260
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 mouse click is within the label text of the treenode instead of row-wide.
2
1149
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
1279
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 have a number printed in the label, which indicates how many children that node has (recursive) so if this was a file system tree for example, I might have D:\ which has the number 1,250 next to it (how many files in all of my D drive), then you...
3
1829
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 answer. I'd appreciate and help. Thanks. What I'm doing is creating a treeview with the structure as follows (this is the expanded view): - Item Status - Item Status Details
10
1248
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 only see what fits there. How do I resize this area? I mean, one would expect the label box to resize itself..... Any ideas?
4
5809
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 -P
9
3694
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. Following is my codes. <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TreeView ID="TreeView1" runat="server" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged"> <Nodes>...
0
3298
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. Provide following view properties to listview, through View menu a. Tile b. Icon
4
14635
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 he can Add, rename or delete a node from the treeview. When he select the new option, the code I use is: treeview1.Nodes.Add("New")
0
8231
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.