Print Page | Close Window

Problem with Slider

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14148
Printed Date: 07 October 2024 at 12:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with Slider
Posted By: redstarsoft
Subject: Problem with Slider
Date Posted: 27 April 2009 at 2:30am
I want Set and Get "Value" of Control...



-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0 (Trial)
Platform: Windows XP (32bit) - SP 3
Language: xHarbour

www.redstarsoft.com.br



Replies:
Posted By: jpbro
Date Posted: 27 April 2009 at 12:31pm
Use CXTPControlSlider (instead of CXTPControlScrollbar), dim your control variable as CommandBarSlider and then set the Control.Pos property to change the position.

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

Language: Visual Basic 6.0 SP6



Posted By: redstarsoft
Date Posted: 27 April 2009 at 1:58pm
can you show a exemple ?

-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0 (Trial)
Platform: Windows XP (32bit) - SP 3
Language: xHarbour

www.redstarsoft.com.br


Posted By: jpbro
Date Posted: 27 April 2009 at 2:06pm
Try this code on a form with a CommandBar control (CommandBars1) on it:


Option Explicit

Private Const mc_IdSlider As Long = 1000

Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
   Select Case Control.Id
   Case mc_IdSlider
      ' Slider has been clicked or changed
      Debug.Print "Slider Value: " & Control.Pos
   End Select
End Sub

Private Sub Form_Load()
   Dim lo_Slider As CommandBarSlider
  
   With Me.CommandBars1
      Set lo_Slider = .CreateCommandBarControl("CXTPControlSlider")
      With lo_Slider
         .Id = mc_IdSlider ' Give the slider control a unique identifier
        
         ' Set slider range & position
         .Min = 0
         .Max = 100
         .Pos = 25   ' Set initial position/value of slider
      End With
     
      .Item(1).Controls.AddControl lo_Slider
   End With
End Sub



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

Language: Visual Basic 6.0 SP6



Posted By: redstarsoft
Date Posted: 27 April 2009 at 2:08pm
i do´t like of style of "CXTPControlSlider"
think that CXTPControlScrollbar is more beautiful.

can i use CXTPcontrolscrollbar same ???

think that have a solucion to use it in VB.

comeone can help ? thanks

-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0 (Trial)
Platform: Windows XP (32bit) - SP 3
Language: xHarbour

www.redstarsoft.com.br


Posted By: jpbro
Date Posted: 27 April 2009 at 2:13pm
Did you try it? Seems to work for me:


Option Explicit

Private Const mc_IdScroll As Long = 1000

Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
   Select Case Control.Id
   Case mc_IdScroll
      ' Scroll has been clicked or changed
      Debug.Print "Scroll Value: " & Control.Pos
   End Select
End Sub

Private Sub Form_Load()
   Dim lo_Scroll As CommandBarScrollBar
  
   With Me.CommandBars1
      Set lo_Scroll = .CreateCommandBarControl("CXTPControlScrollBar")
      With lo_Scroll
         .Id = mc_IdScroll ' Give the Scroll control a unique identifier
        
         ' Set Scroll range & position
         .Min = 0
         .Max = 100
         .Pos = 25   ' Set initial position/value of Scroll
      End With
     
      .Item(1).Controls.AddControl lo_Scroll
   End With
End Sub



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

Language: Visual Basic 6.0 SP6



Posted By: redstarsoft
Date Posted: 27 April 2009 at 2:18pm
OHHHHHHHHH perfect jbbro

thanks so much :D

very good

-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0 (Trial)
Platform: Windows XP (32bit) - SP 3
Language: xHarbour

www.redstarsoft.com.br


Posted By: redstarsoft
Date Posted: 27 April 2009 at 2:36pm
is possible change slider to vertical ?

-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0 (Trial)
Platform: Windows XP (32bit) - SP 3
Language: xHarbour

www.redstarsoft.com.br


Posted By: jpbro
Date Posted: 28 April 2009 at 6:38am
Glad to help!

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

Language: Visual Basic 6.0 SP6




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