locked
Visual Basic 2010 Slider RRS feed

  • Question

  • OK, I want to make that thing on iPhones "Slide to unlock" in Visual Basic 2010. But it isn't as easy as I thought. Does anyone know how to do that? Are there any DLLs for the ToolBox for a slider that allows you to use your own image? 

    Here's what I've tried. I made a Panel and a PictureBox, to slide the image on it. But I have no idea how to do that. I tried with HScrollBar but it didn't work. Can anyone give me a suitable code for my problem? PLEASE.


    Gabryel High-Tech
    Wednesday, October 12, 2011 6:02 PM

Answers

  • Deleted
    • Proposed as answer by Mike Feng Friday, October 14, 2011 10:08 AM
    • Marked as answer by Mike Feng Friday, October 21, 2011 6:37 AM
    Wednesday, October 12, 2011 7:14 PM
  • OK, I want to make that thing on iPhones "Slide to unlock" in Visual Basic 2010. But it isn't as easy as I thought. Does anyone know how to do that? Are there any DLLs for the ToolBox for a slider that allows you to use your own image? 

    Here's what I've tried. I made a Panel and a PictureBox, to slide the image on it. But I have no idea how to do that. I tried with HScrollBar but it didn't work. Can anyone give me a suitable code for my problem? PLEASE.


    Gabryel High-Tech

    Hi,

    Add a few buttons or whatever towards the centre of a Form and try this code please.

     

    Public Class Form1
    
        Friend WithEvents OnOffScroll As New HScrollBar
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            OnOffScroll.Name = "OnOffScroll"
            OnOffScroll.Location = New Point(10, 10)
            OnOffScroll.Size = New Size(Me.Width - 50, 20)
            OnOffScroll.SmallChange = 1
            OnOffScroll.LargeChange = 1
            OnOffScroll.Minimum = 0
            OnOffScroll.Maximum = 1
            OnOffScroll.Value = 1
            Me.Controls.Add(OnOffScroll)
    
        End Sub
    
        Private Sub OnOffScroll_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles OnOffScroll.ValueChanged
    
            If OnOffScroll.Value = 1 Then
                For Each ctrl As Control In Me.Controls
                    If ctrl.Name <> "OnOffScroll" Then
                        ctrl.Show()
                    End If
                Next
            ElseIf OnOffScroll.Value = 0 Then
                For Each ctrl As Control In Me.Controls
                    If ctrl.Name <> "OnOffScroll" Then
                        ctrl.Hide()
                    End If
                Next
            End If
    
        End Sub
    End Class
    


     




    Regards,

    profile for John Anthony Oliver at Stack Overflow, Q&A for professional and enthusiast programmers

    Click this link to see the NEW way of how to insert a picture into a forum post.

    Installing VB6 on Windows 7

    App Hub for Windows Phone & XBOX 360 developers.

    • Edited by John Anthony Oliver Wednesday, October 12, 2011 10:04 PM
    • Proposed as answer by Mike Feng Friday, October 14, 2011 10:08 AM
    • Marked as answer by Mike Feng Friday, October 21, 2011 6:37 AM
    Wednesday, October 12, 2011 10:01 PM
  • Hi Gabryel,

    Welcome to the MSDN Forum.

    Based on your description, it seems that you intend to use VB.net to develop a program which run on Iphone.

    If I am right, please try to use Mono .net framework to achieve it.

    Here is the website: http://www.mono-project.com/Main_Page

    Mono is a software platform designed to allow developers to easily create cross platform applications. Sponsored by Xamarin, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of Linux applications.

    This response contains links reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Friday, October 21, 2011 6:37 AM
    Friday, October 14, 2011 10:07 AM

All replies

  • OK, I want to make that thing on iPhones "Slide to unlock" in Visual Basic 2010. But it isn't as easy as I thought. Does anyone know how to do that? Are there any DLLs for the ToolBox for a slider that allows you to use your own image? 

    Here's what I've tried. I made a Panel and a PictureBox, to slide the image on it. But I have no idea how to do that. I tried with HScrollBar but it didn't work. Can anyone give me a suitable code for my problem? PLEASE.


    Gabryel High-Tech

    Hi,

    Add a few buttons or whatever towards the centre of a Form and try this code please.

     

    Public Class Form1
    
        Friend WithEvents OnOffScroll As New HScrollBar
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            OnOffScroll.Name = "OnOffScroll"
            OnOffScroll.Location = New Point(10, 10)
            OnOffScroll.Size = New Size(Me.Width - 50, 20)
            OnOffScroll.SmallChange = 1
            OnOffScroll.LargeChange = 1
            OnOffScroll.Minimum = 0
            OnOffScroll.Maximum = 1
            OnOffScroll.Value = 1
            Me.Controls.Add(OnOffScroll)
    
        End Sub
    
        Private Sub OnOffScroll_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles OnOffScroll.ValueChanged
    
            If OnOffScroll.Value = 1 Then
                For Each ctrl As Control In Me.Controls
                    If ctrl.Name <> "OnOffScroll" Then
                        ctrl.Show()
                    End If
                Next
            ElseIf OnOffScroll.Value = 0 Then
                For Each ctrl As Control In Me.Controls
                    If ctrl.Name <> "OnOffScroll" Then
                        ctrl.Hide()
                    End If
                Next
            End If
    
        End Sub
    End Class
    


     




    Regards,

    profile for John Anthony Oliver at Stack Overflow, Q&A for professional and enthusiast programmers

    Click this link to see the NEW way of how to insert a picture into a forum post.

    Installing VB6 on Windows 7

    App Hub for Windows Phone & XBOX 360 developers.

    • Edited by John Anthony Oliver Wednesday, October 12, 2011 10:04 PM
    • Proposed as answer by Mike Feng Friday, October 14, 2011 10:08 AM
    • Marked as answer by Mike Feng Friday, October 21, 2011 6:37 AM
    Wednesday, October 12, 2011 10:01 PM
  • Hi Gabryel,

    Welcome to the MSDN Forum.

    Based on your description, it seems that you intend to use VB.net to develop a program which run on Iphone.

    If I am right, please try to use Mono .net framework to achieve it.

    Here is the website: http://www.mono-project.com/Main_Page

    Mono is a software platform designed to allow developers to easily create cross platform applications. Sponsored by Xamarin, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of Linux applications.

    This response contains links reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Friday, October 21, 2011 6:37 AM
    Friday, October 14, 2011 10:07 AM