How To: the little triangle for drop-down-button?

  • Thread starter Thread starter Boris Nienke
  • Start date Start date
B

Boris Nienke

Hi,

because i cannot edit in a Combo-Box i have designed by own pseudo-combo by
using:
- an Edit
- a button
- a ListBox

Ok, this works. But how can i put this little triangle on the button? I
cannot change the Font-name at designtime (because i just can select from
the desktop-fonts, not from the PocketPC-Fonts) so i have no idea if
there's something like Wingdings or so where such symbol is in?

thank you

Boris
 
I think you'd be better off by creating your own button, by deriving from Control and using either an image or draw a triangle yourself using Graphics.DrawPoligon

-
Alex Yakhnin, .NET CF MV
www.intelliprog.com|www.opennetcf.or

----- Boris Nienke wrote: ----

Hi

because i cannot edit in a Combo-Box i have designed by own pseudo-combo b
using
- an Edi
- a butto
- a ListBo

Ok, this works. But how can i put this little triangle on the button?
cannot change the Font-name at designtime (because i just can select fro
the desktop-fonts, not from the PocketPC-Fonts) so i have no idea i
there's something like Wingdings or so where such symbol is in

thank yo

Bori
 
There's a quickstart showing how to do this here:
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/picturebutton.a
spx

-Katie

This posting is provided "AS IS" with no warranties, and confers no rights.

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

--------------------
| Thread-Topic: How To: the little triangle for drop-down-button?
| thread-index: AcPfW8EDx1zYNKOMQ82c/pRMiRgKIQ==
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| From: =?Utf-8?B?QWxleCBZYWtobmluIFtNVlBd?=
<[email protected]>
| References: <[email protected]>
| Subject: RE: How To: the little triangle for drop-down-button?
| Date: Tue, 20 Jan 2004 05:46:06 -0800
| Lines: 25
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:43495
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I think you'd be better off by creating your own button, by deriving from
Control and using either an image or draw a triangle yourself using
Graphics.DrawPoligon.

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com|www.opennetcf.org

----- Boris Nienke wrote: -----

Hi,

because i cannot edit in a Combo-Box i have designed by own
pseudo-combo by
using:
- an Edit
- a button
- a ListBox

Ok, this works. But how can i put this little triangle on the button? I
cannot change the Font-name at designtime (because i just can select
from
the desktop-fonts, not from the PocketPC-Fonts) so i have no idea if
there's something like Wingdings or so where such symbol is in?

thank you

Boris

|
 
When I designed my own owner drawn combobox I used the following code snip
in my OnPaint sub for the control...

Dim DropPenF As Drawing.SolidBrush
If Me.DroppedDown Then
DropPenF = New Drawing.SolidBrush(Color.White)
BackBrush = New Drawing.SolidBrush(Color.Black)
Else
DropPenF = New Drawing.SolidBrush(Color.Black)
BackBrush = New Drawing.SolidBrush(Color.White)
End If
Dim DropPen As New Drawing.Pen(SystemColors.ControlText)
Dim pts(2) As Point

pts(0) = New Point(Me.Width - 11, Int((m_Textbox.Height + 4) / 2) - 1)
pts(1) = New Point(Me.Width - 5, Int((m_Textbox.Height + 4) / 2) - 1)
pts(2) = New Point(Me.Width - 8, Int((m_Textbox.Height + 4) / 2) + 2)
g.DrawPolygon(DropPen, pts)
g.FillPolygon(DropPenF, pts)

m_Textbox is a Textbox I use for the editable section of the control. This
code will put a small Black triangle in the right side of the Textbox
portion of the combobox. Backbrush is used elsewhere to fill in the
background of a selected control.

Paul Stork
(e-mail address removed)
 
Hi Boris,

I did the same thing as you. I called it "Editable Combobox light".
Thanks to Alex I found the font called "Bookdings".
The important code is:

this.yourButton.Font = new System.Drawing.Font("Bookdings", 10F,
System.Drawing.FontStyle.Regular);
this.yourButton.Text = "6";

Christoph
 
Back
Top