PC Review


Reply
Thread Tools Rate Thread

Converting Borland C++ app to C# (question about Button type)

 
 
Jungle Boy
Guest
Posts: n/a
 
      19th Dec 2006
I'm trying to convert a Borland C++ app to C#

Borland C++ has 3 types of buttons:
TButton, TBitBtn and TSpeedbutton

TSpeedbutton has 'Down' and 'GroupIndex' properties.

The 'Down' state is useful for controlling the button up/down
state from say a timer event.

The 'GroupIndex' allows a group of SpeedButtons to act like
radio buttons. A value of 0 switches this feature off.

C# doesn't seem to have anything like this.

Does anyone know how I can access these features?

-JB


 
Reply With Quote
 
 
 
 
Oliver Sturm
Guest
Posts: n/a
 
      19th Dec 2006
Hello Jungle,

>Borland C++ has 3 types of buttons:
>TButton, TBitBtn and TSpeedbutton


These are controls that Borland created themselves, they are not part of
the .NET framework.

The standard Button control in the .NET Framework can show an image, but I
don't think it has an equivalent of the Down or GroupIndex properties. You
might want to look into one of the available third party control packages,
there's an abundance of these and most can probably satisfy your
requirements.


Oliver Sturm
--
http://www.sturmnet.org/blog
 
Reply With Quote
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      19th Dec 2006
Hi,

It's not C# it's the framework that do not have those classes.

Do you need those extra features?

Otherwise just use the "regular" Button , you will need to rewrite some more
code though (but I see no way to avoid that anyway)


--
Ignacio Machin
machin AT laceupsolutions com



"Jungle Boy" <jungle.boy(AT)btconnect.com> wrote in message
news:(E-Mail Removed)...
> I'm trying to convert a Borland C++ app to C#
>
> Borland C++ has 3 types of buttons:
> TButton, TBitBtn and TSpeedbutton
>
> TSpeedbutton has 'Down' and 'GroupIndex' properties.
>
> The 'Down' state is useful for controlling the button up/down
> state from say a timer event.
>
> The 'GroupIndex' allows a group of SpeedButtons to act like
> radio buttons. A value of 0 switches this feature off.
>
> C# doesn't seem to have anything like this.
>
> Does anyone know how I can access these features?
>
> -JB
>
>



 
Reply With Quote
 
Jani Järvinen [MVP]
Guest
Posts: n/a
 
      19th Dec 2006
Hello JB,

> The 'Down' state is useful for controlling the button up/down
> state from say a timer event.
> The 'GroupIndex' allows a group of SpeedButtons to act like
> radio buttons. A value of 0 switches this feature off.
> C# doesn't seem to have anything like this.


True, there isn't a one-to-one mapping in these features between OWL
(Borland C++) or VCL (Borland C++Builder) and C#/WinForms.

However, .NET's ToolStrip container and its ToolStripButtons have a property
called Checked (and the linked CheckedState property) that is essentially
the same as your TSpeedButton's Down property. Yes, the button doesn't go
"down", but instead changes color, which is the modern Windows convention to
the older 90s convention/visualization used by Borland C++.

Now, GroupIndex is something I think you cannot do without coding, at least
from the top of my head. However, creating a group of ToolStripButtons that
would act as a group is almost trivial. In fact, you might wish to inherit
your own buttons from ToolStripButton, which could have this feature
implemented "built-in".

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(E-Mail Removed)
http://www.saunalahti.fi/janij/


 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      19th Dec 2006
Jungle Boy (AT) wrote:
> I'm trying to convert a Borland C++ app to C#
>
> Borland C++ has 3 types of buttons:
> TButton, TBitBtn and TSpeedbutton
>
> TSpeedbutton has 'Down' and 'GroupIndex' properties.
>
> The 'Down' state is useful for controlling the button up/down
> state from say a timer event.
>
> The 'GroupIndex' allows a group of SpeedButtons to act like
> radio buttons. A value of 0 switches this feature off.


Can't you use RadioButtons and set their Appearance property to Button?
If you put them inside a GroupBox, doesn't that give you the
functionality you need?

 
Reply With Quote
 
Jungle Boy
Guest
Posts: n/a
 
      19th Dec 2006
Thanks for all your suggestions.
I'll give them a try.
-JB


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormCode - Converting Type-E UPC to Type-A (barcodes) AFSSkier Microsoft Access Form Coding 2 25th Jan 2010 05:41 PM
Converting form C# alias type to .NET framework type =?Utf-8?B?U2hhcm9u?= Microsoft C# .NET 3 1st Nov 2006 04:38 PM
minimize button and hiding Type question for help. =?Utf-8?B?VGVycnk=?= Microsoft Word Document Management 3 3rd Jun 2005 07:06 PM
Re: Borland C# Builder Auto Code Formatting Question Mike Bresnahan Microsoft C# .NET 4 11th Nov 2003 03:00 AM
Borland C# Builder Auto Code Formatting Question Morg Microsoft C# .NET 0 5th Oct 2003 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 AM.