I haven't received an answer to my question of a few days ago regarding a
flipped treeview control posted in the dotnet.framework.windowsforms.control
newsgroup, so I thought I'd ask it again. Sorry about the cross-posting,
but I'm getting desperate as the drop-dead date, the 25th of this month, on
my project approaches.

I'm attempting to create a TreeView similar to the one on the right-hand
side of the BizTalk Mapper screen. I'm able to create a mirror image of a
normal TreeView with everything swapped left-for-right, kind of like looking
at the reflection of the tree in a mirror; unfortunately, that everything
also includes the text for each node. Is there a way of creating a bitmap of
each visible node and performing a
Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to performing
a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the bitmap of the
entire tree? Is there another way of accomplishing the same thing?

Any help would be greatly appreciated.

Re: Reversing text in TreeView nodes by Bob

Bob
Fri Feb 18 07:51:41 CST 2005

The only way you can do this is to custom draw the whole treeview. I assume
that you're capturing an image and then flipping that. This method will
never allow you to separate the text from the graphic and selectively flip
or move depending on positions in the bitmap.

Treeviews are common controls underneath. You should be able to use the
WM_NOTIFY based custom draw messages to draw the nodes in a right-to-left
cascade.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Allen Anderson" <albruan@comcast.net> wrote in message
news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
>I haven't received an answer to my question of a few days ago regarding a
>flipped treeview control posted in the
>dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it
>again. Sorry about the cross-posting, but I'm getting desperate as the
>drop-dead date, the 25th of this month, on my project approaches.
>
> I'm attempting to create a TreeView similar to the one on the right-hand
> side of the BizTalk Mapper screen. I'm able to create a mirror image of a
> normal TreeView with everything swapped left-for-right, kind of like
> looking at the reflection of the tree in a mirror; unfortunately, that
> everything also includes the text for each node. Is there a way of
> creating a bitmap of each visible node and performing a
> Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
> performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
> bitmap of the entire tree? Is there another way of accomplishing the same
> thing?
>
> Any help would be greatly appreciated.
>



Re: Reversing text in TreeView nodes by Mick

Mick
Fri Feb 18 09:12:42 CST 2005

Quick hack in VB.Net

Inherit from Treeview and add the following code:
\\\
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const WS_EX_LAYOUTRTL As Integer = &H400000
Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
If Me.Mirror Then
cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
End If
Return cp
End Get
End Property

Private m_Mirror As Boolean = False

<DefaultValue(False)> _
Public Property Mirror() As Boolean
Get
Return m_Mirror
End Get
Set(ByVal Value As Boolean)
If m_Mirror = Value Then Return
m_Mirror = Value
MyBase.UpdateStyles()
End Set
End Property
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Allen Anderson" <albruan@comcast.net> wrote in message
news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
>I haven't received an answer to my question of a few days ago regarding a
>flipped treeview control posted in the
>dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it
>again. Sorry about the cross-posting, but I'm getting desperate as the
>drop-dead date, the 25th of this month, on my project approaches.
>
> I'm attempting to create a TreeView similar to the one on the right-hand
> side of the BizTalk Mapper screen. I'm able to create a mirror image of a
> normal TreeView with everything swapped left-for-right, kind of like
> looking at the reflection of the tree in a mirror; unfortunately, that
> everything also includes the text for each node. Is there a way of
> creating a bitmap of each visible node and performing a
> Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
> performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
> bitmap of the entire tree? Is there another way of accomplishing the same
> thing?
>
> Any help would be greatly appreciated.
>



Re: Reversing text in TreeView nodes by Bob

Bob
Fri Feb 18 09:37:26 CST 2005

Learn something new every day....

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:%23EsrNxcFFHA.2828@TK2MSFTNGP09.phx.gbl...
> Quick hack in VB.Net
>
> Inherit from Treeview and add the following code:
> \\\
> Protected Overrides ReadOnly Property CreateParams() As CreateParams
> Get
> Dim cp As CreateParams = MyBase.CreateParams
> Const WS_EX_LAYOUTRTL As Integer = &H400000
> Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
> If Me.Mirror Then
> cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
> End If
> Return cp
> End Get
> End Property
>
> Private m_Mirror As Boolean = False
>
> <DefaultValue(False)> _
> Public Property Mirror() As Boolean
> Get
> Return m_Mirror
> End Get
> Set(ByVal Value As Boolean)
> If m_Mirror = Value Then Return
> m_Mirror = Value
> MyBase.UpdateStyles()
> End Set
> End Property
> ///
>
> --
> Mick Doherty
> http://dotnetrix.co.uk/nothing.html
>
>
> "Allen Anderson" <albruan@comcast.net> wrote in message
> news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
>>I haven't received an answer to my question of a few days ago regarding a
>>flipped treeview control posted in the
>>dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it
>>again. Sorry about the cross-posting, but I'm getting desperate as the
>>drop-dead date, the 25th of this month, on my project approaches.
>>
>> I'm attempting to create a TreeView similar to the one on the right-hand
>> side of the BizTalk Mapper screen. I'm able to create a mirror image of a
>> normal TreeView with everything swapped left-for-right, kind of like
>> looking at the reflection of the tree in a mirror; unfortunately, that
>> everything also includes the text for each node. Is there a way of
>> creating a bitmap of each visible node and performing a
>> Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
>> performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
>> bitmap of the entire tree? Is there another way of accomplishing the
>> same thing?
>>
>> Any help would be greatly appreciated.
>>
>
>



Re: Reversing text in TreeView nodes by AlBruAn

AlBruAn
Fri Feb 18 10:01:03 CST 2005

Mick and Bob,

Both of you guys are great! This is exactly what I needed!

"Bob Powell [MVP]" wrote:

> Learn something new every day....
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tipstricks.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/faqmain.htm
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "Mick Doherty"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
> message news:%23EsrNxcFFHA.2828@TK2MSFTNGP09.phx.gbl...
> > Quick hack in VB.Net
> >
> > Inherit from Treeview and add the following code:
> > \\\
> > Protected Overrides ReadOnly Property CreateParams() As CreateParams
> > Get
> > Dim cp As CreateParams = MyBase.CreateParams
> > Const WS_EX_LAYOUTRTL As Integer = &H400000
> > Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
> > If Me.Mirror Then
> > cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
> > End If
> > Return cp
> > End Get
> > End Property
> >
> > Private m_Mirror As Boolean = False
> >
> > <DefaultValue(False)> _
> > Public Property Mirror() As Boolean
> > Get
> > Return m_Mirror
> > End Get
> > Set(ByVal Value As Boolean)
> > If m_Mirror = Value Then Return
> > m_Mirror = Value
> > MyBase.UpdateStyles()
> > End Set
> > End Property
> > ///
> >
> > --
> > Mick Doherty
> > http://dotnetrix.co.uk/nothing.html
> >
> >
> > "Allen Anderson" <albruan@comcast.net> wrote in message
> > news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
> >>I haven't received an answer to my question of a few days ago regarding a
> >>flipped treeview control posted in the
> >>dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it
> >>again. Sorry about the cross-posting, but I'm getting desperate as the
> >>drop-dead date, the 25th of this month, on my project approaches.
> >>
> >> I'm attempting to create a TreeView similar to the one on the right-hand
> >> side of the BizTalk Mapper screen. I'm able to create a mirror image of a
> >> normal TreeView with everything swapped left-for-right, kind of like
> >> looking at the reflection of the tree in a mirror; unfortunately, that
> >> everything also includes the text for each node. Is there a way of
> >> creating a bitmap of each visible node and performing a
> >> Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
> >> performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
> >> bitmap of the entire tree? Is there another way of accomplishing the
> >> same thing?
> >>
> >> Any help would be greatly appreciated.
> >>
> >
> >
>
>
>

Re: Reversing text in TreeView nodes by VBen

VBen
Fri Feb 18 11:57:18 CST 2005

That's the cleanest, most direct and most elegant solution I've EVER seen
for a problem this potentially complicated....
Wow!!
VBen.

"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> escribió
en el mensaje news:#EsrNxcFFHA.2828@TK2MSFTNGP09.phx.gbl...
> Quick hack in VB.Net
>
> Inherit from Treeview and add the following code:
> \\\
> Protected Overrides ReadOnly Property CreateParams() As CreateParams
> Get
> Dim cp As CreateParams = MyBase.CreateParams
> Const WS_EX_LAYOUTRTL As Integer = &H400000
> Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
> If Me.Mirror Then
> cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
> End If
> Return cp
> End Get
> End Property
>
> Private m_Mirror As Boolean = False
>
> <DefaultValue(False)> _
> Public Property Mirror() As Boolean
> Get
> Return m_Mirror
> End Get
> Set(ByVal Value As Boolean)
> If m_Mirror = Value Then Return
> m_Mirror = Value
> MyBase.UpdateStyles()
> End Set
> End Property
> ///
>
> --
> Mick Doherty
> http://dotnetrix.co.uk/nothing.html
>
>
> "Allen Anderson" <albruan@comcast.net> wrote in message
> news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
> >I haven't received an answer to my question of a few days ago regarding a
> >flipped treeview control posted in the
> >dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it
> >again. Sorry about the cross-posting, but I'm getting desperate as the
> >drop-dead date, the 25th of this month, on my project approaches.
> >
> > I'm attempting to create a TreeView similar to the one on the right-hand
> > side of the BizTalk Mapper screen. I'm able to create a mirror image of
a
> > normal TreeView with everything swapped left-for-right, kind of like
> > looking at the reflection of the tree in a mirror; unfortunately, that
> > everything also includes the text for each node. Is there a way of
> > creating a bitmap of each visible node and performing a
> > Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
> > performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
> > bitmap of the entire tree? Is there another way of accomplishing the
same
> > thing?
> >
> > Any help would be greatly appreciated.
> >
>
>



Re: Reversing text in TreeView nodes by VBen

VBen
Sat Feb 19 16:19:56 CST 2005

If anyone is interested, I tried this solution.
It's great, since it does exactly that: Draw the nodes cascade in a right to
left cascade... There's just one problem: Wether you establish
"WS_EX_NOINHERITLAYOUT" or not, the images in the treeview are drawn
mirrored, and the text is drawn correctly (I tried establishing also
WS_EX_RTLREADING with the same results).
The solution is as simple as mirroring images before loading them into the
ImageList control, but if anyone has the correct solution for that
particular problem, I'd like to know about it (just curious)...
Regards,
VBen.

"VBen" <bmorayta@compucaremexico.com> escribió en el mensaje
news:u7UnLNeFFHA.2508@TK2MSFTNGP10.phx.gbl...
> That's the cleanest, most direct and most elegant solution I've EVER seen
> for a problem this potentially complicated....
> Wow!!
> VBen.
>
> "Mick Doherty"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
escribió
> en el mensaje news:#EsrNxcFFHA.2828@TK2MSFTNGP09.phx.gbl...
> > Quick hack in VB.Net
> >
> > Inherit from Treeview and add the following code:
> > \\\
> > Protected Overrides ReadOnly Property CreateParams() As CreateParams
> > Get
> > Dim cp As CreateParams = MyBase.CreateParams
> > Const WS_EX_LAYOUTRTL As Integer = &H400000
> > Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
> > If Me.Mirror Then
> > cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
> > End If
> > Return cp
> > End Get
> > End Property
> >
> > Private m_Mirror As Boolean = False
> >
> > <DefaultValue(False)> _
> > Public Property Mirror() As Boolean
> > Get
> > Return m_Mirror
> > End Get
> > Set(ByVal Value As Boolean)
> > If m_Mirror = Value Then Return
> > m_Mirror = Value
> > MyBase.UpdateStyles()
> > End Set
> > End Property
> > ///
> >
> > --
> > Mick Doherty
> > http://dotnetrix.co.uk/nothing.html
> >
> >
> > "Allen Anderson" <albruan@comcast.net> wrote in message
> > news:SYadnUwKFs0BQojfRVn-3Q@comcast.com...
> > >I haven't received an answer to my question of a few days ago regarding
a
> > >flipped treeview control posted in the
> > >dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask
it
> > >again. Sorry about the cross-posting, but I'm getting desperate as the
> > >drop-dead date, the 25th of this month, on my project approaches.
> > >
> > > I'm attempting to create a TreeView similar to the one on the
right-hand
> > > side of the BizTalk Mapper screen. I'm able to create a mirror image
of
> a
> > > normal TreeView with everything swapped left-for-right, kind of like
> > > looking at the reflection of the tree in a mirror; unfortunately, that
> > > everything also includes the text for each node. Is there a way of
> > > creating a bitmap of each visible node and performing a
> > > Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to
> > > performing a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the
> > > bitmap of the entire tree? Is there another way of accomplishing the
> same
> > > thing?
> > >
> > > Any help would be greatly appreciated.
> > >
> >
> >
>
>