Print Page | Close Window

PushButton.BuddyControl & Resize

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17454
Printed Date: 01 October 2024 at 5:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PushButton.BuddyControl & Resize
Posted By: Jean
Subject: PushButton.BuddyControl & Resize
Date Posted: 19 October 2010 at 10:16am
I like to have a FlatEdit with a PushButton as buddycontrol right-justified on a form.
But it doesn't work with resize.

Put a FlatEdit and a PushButton on a Form. Use this code:

Private Sub Form_Load()
PushButton1.BuddyControl = FlatEdit1
End Sub

Private Sub Form_Resize()
On Error Resume Next
FlatEdit1.Width = Me.ScaleWidth - 2300
PushButton1.BuddyControl = FlatEdit1
End Sub


If you run the application and resize the form you will notice that the button is at the correct position.
But as soon as you change the text in the FlatEdit and resize again, the PushButton buddy thing doesn't work anymore.  Cry


-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0



Replies:
Posted By: jpbro
Date Posted: 19 October 2010 at 5:06pm
Confirmed in 13.4.0 for me too - can anyone try this in 13.4.2 to see if it is still a problem?




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 11 December 2010 at 4:00pm
Still a problem in latest beta.

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 13 December 2010 at 1:44pm
Hi,

BuddyControl is string property. you need set it as

PushButton1.BuddyControl = "FlatEdit1"


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 13 December 2010 at 2:57pm
Ah! Thanks Oleg, our mistake Embarrassed

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Willowmaster
Date Posted: 14 December 2010 at 3:09am
What is the default property of a FlatEdit? If it's the name it should work as you tried.

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: Jean
Date Posted: 15 December 2010 at 11:01am
Thank you.
Didn't notice the little mistake.  Embarrassed


-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0


Posted By: Jean
Date Posted: 09 March 2011 at 4:36am
I still have a problem with the buddy control property:
What I like to have is a resizable UserControl with a FlatEdit+PushButton inside.
Try this:
1) Put a FlatEdit on a UserControl
2) Put a PushButton on the same UserControl
3) Use this code:

Private Sub UserControl_Initialize()
PushButton1.BuddyControl = "FlatEdit1"
End Sub

Private Sub UserControl_Resize()
On Error Resume Next
FlatEdit1.Move 0, 0, UserControl.ScaleWidth - PushButton1.Width, UserControl.ScaleHeight
PushButton1.BuddyControl = "FlatEdit1"
End Sub

4) Compile the Ocx.
5) Use the compiled control: Create a new standard exe project. Put the new Control on the form. Save the project, close the project: Error message!  Cry

-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net