Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Curvature property to TextBox, etc.

Status
Not open for further replies.

NasibKalsi

Programmer
Jan 8, 2004
417
CA
Is it fair to ask MS to add CURVATURE property to the TextBox, EditBox and some other rectangular controls ?

I assume it does not exist or is hard to implement.


My Best

Nasib Kalsi
 
Not hard to implement... but (IMO) not worth the hassle due to the coding involved.
Create a container class. Add a textbox with no borders, change special effects to plain set the back style to 1-Opaque, put a shape over it. Set the border style of the shape to 6 - inside solid, Curvature to 25, Back style to Opaque. Both should have the same color.
You will have to change the color of the shape, when the Text Box or Edit Box is diabled, to match, Resize them together etc in code. If there is no resize involved you may not even have to create a class (but it is double work)

Bindevent() is a great candidate for this.

Well what do you know, I just tried it (no class) and it looks neat. When the Textbox is disabled (Grey) it does not look bad at all. (May not be a hassle after all)

Public oform1
oform1=Newobject("form1")
oform1.Show
Return
Define Class form1 As Form
Top = 10
Left = 45
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
Add Object shape1 As Shape With ;
Top = 25, ;
Left = 45, ;
Height = 27, ;
Width = 106, ;
BackStyle = 1, ;
BorderStyle = 6, ;
Curvature = 25, ;
BackColor = Rgb(255,255,255), ;
Name = "Shape1"
Add Object text1 As TextBox With ;
BackStyle = 1, ;
BorderStyle = 0, ;
Enabled = .F., ;
Height = 21, ;
Left = 52, ;
SpecialEffect = 1, ;
Top = 28, ;
Width = 91, ;
Themes = .F., ;
Name = "Text1"
Enddefine
 
I did this with a form. It wasn't not too difficult, and it looked OK, but only when the form's BackColor was the same as that of the form (or _SCREEN) behind it. Once I moved the form over a form with a different BackColor, it looked ragged.

I started trying to figure out a solution, but eventually decided it wasn't worth the effort. Cosmetic effects like these are all well and good, but they don't really help your customers overcome their business problems.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks ImagineCorp and Mike for your suggestions. The problem arrives at design time. I think it may not be a big deal for MicroSoft to implement Curvature in the Rectangular Objects, as it is done in the Command Button.


Nasib Kalsi


 
Nasib: I hate the color scheme Microsoft uses. They are garish. Well I spent 2 day trying to figuire out how to change the colors of the screen & Forms Title bar and borders without changing the colors of other MS apps. I have put this in the wish list, so lets see.
Tried everything... had it working but it was not reliable and not worth the coding involved.
Bindevent() handeled everything.
Good example (yours) for coloring grid textbox
Good Night...
 
It may not be too much to ask, but I feel pretty confident in saying that it won't happen, at least not for Sedna. Microsoft has been pretty clear that Sedna will have minimal changes to the VFP executable and focus on extensions.

Tamar
 
Imaginecorp, thanks for the time you spent on trying to find a solution.

Also, is there a place somewhere, that programmers/analysts could express the WISH LIST and Microsoft could examine it and possibly implement ?


Nasib
 
Couldn't one draw (any) shape around a standard control (textbox) using the object location, size and color properties as paramaters?

DO FORM HOME()+"\Samples\Solution\Forms\Graphics\Fdmain.scx"

Brian
 
Nasib,

You asked:
is there a place somewhere, that programmers/analysts could express the WISH LIST and Microsoft could examine it and possibly implement ?

Yes. It's at:

I know that VFP folk at Microsoft do read this list.

However, I agree with Tamar that the sort of feature you are looking for is unlikely to happen any time soon. For things like curved textboxes, you'd be better either trying to do it yourself or look for a third-party ActiveX control.

Imaginecorp: When it comes to changing fundamental things like the colour of the title bar, I can only repeat what's been said many times. These choices are made by the user through their control panel settings, and we developers should not override them.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I could not agree more about changing the user settings.
The problem I am facing is:
Our app allows users to create their own personnel profiles. i.e. Change the color of the forms, and every control including resizing them. This is saved and every time the particular user logs on, our app opens with his/her settings. This feature is a favorite of users with visual disabilities. Themes have always been disabled.
Now we are trying to woo a national client who would like to see themes enabled as all users are running XP with themes enabled. Our app looks garish with the Default Blue. Silver complements our app.
The only change required was to change the colors of our Forms Title bars and borders, NOT the screen title bar, as they inherit from windows. These are the only setting that cannot be set within VFP, which IMO, can do anything and everything to not have this functionality seems, silly.
That’s all I was trying to figure out without resorting to changing colors at the OS level then resetting them.
I created a custom form classes with title bar set to Off, Border style set to none, put containers in place of the title bars and borders with events to synchronize them with the underlying forms resize, move, close, minimize etc.
It worked but it was unreliable and would be a bear to support, took me 2 days to get it to work.
At a loss here…
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top