none
Textbox sound and property Fixed3D problems. RRS feed

  • Question

  • Hi,

    I have create a Windows Form with serveral textboxes. And i have made it so, that when i have filled in something in one textbox, i give a enter so that he jumps to the other textbox. And so on. The problem is that with every jump the Microsoft system gives a sound. Like "PLOIIING". And that is rather irritating. My question is: is there something i can do against it? How do i stop it? I have tried it with My.Computer.Audio.Stop(). But the system ingnores it.

    Second point:

    I don't know if you have created last time a Windows Form in Windows 10 with VS 2017?  Where you used the property box for the setting FormBorderStyle into Fixed3D. Well, if you have done it, did the Form borders look like 3D? If the answer is NO! Oké then, but what can we do about it? Even when you create a form by code instead of the add function in the solution explorer, the property FormBorderStyle = Fixed3D does not work. I mean, it give not 3D borders.  Maybe you know a solution for it, if you have the same experience with Windows 10 as i do. In Windows 7 it did work perfect. Not now with Windows 10.

    Regards,

    Willem.

     

    Tuesday, February 13, 2018 7:38 PM

Answers

  • May I ask why you are attempting to create an app with a old style form? Without getting into a good deal of custom code it's not possible to do the 3D in Windows 10.

    For the sound, here is code to stop sound and move to the next tabbed control on pressing enter.

    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            e.Handled = True
            e.SuppressKeyPress = True
            SelectNextControl(ActiveControl, True, True, True, True)
        End If
    End Sub

    For all text boxes

    Private Sub csvForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Controls.OfType(Of TextBox).ToList.ForEach(
            Sub(tb)
                AddHandler tb.KeyDown, AddressOf TextBox1_KeyDown
            End Sub)
    End Sub
    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs)
        If e.KeyCode = Keys.Enter Then
            e.Handled = True
            e.SuppressKeyPress = True
            SelectNextControl(ActiveControl, True, True, True, True)
        End If
    End Sub


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Tuesday, February 13, 2018 8:36 PM
    Moderator

All replies

  • The problem is that with every jump the Microsoft system gives a sound. Like "PLOIIING".

    Show the code that you are using to allow the Enter key to move the focus to the next control.  It seems that you are not suppressing the Enter key.

    For your borderstyle problem you should post an image of what you expect to get and what you actually get.

    Tuesday, February 13, 2018 8:14 PM
  • May I ask why you are attempting to create an app with a old style form? Without getting into a good deal of custom code it's not possible to do the 3D in Windows 10.

    For the sound, here is code to stop sound and move to the next tabbed control on pressing enter.

    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            e.Handled = True
            e.SuppressKeyPress = True
            SelectNextControl(ActiveControl, True, True, True, True)
        End If
    End Sub

    For all text boxes

    Private Sub csvForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Controls.OfType(Of TextBox).ToList.ForEach(
            Sub(tb)
                AddHandler tb.KeyDown, AddressOf TextBox1_KeyDown
            End Sub)
    End Sub
    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs)
        If e.KeyCode = Keys.Enter Then
            e.Handled = True
            e.SuppressKeyPress = True
            SelectNextControl(ActiveControl, True, True, True, True)
        End If
    End Sub


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Tuesday, February 13, 2018 8:36 PM
    Moderator
  • Hi Karen,

    You may ask me a lot. But before i answer it, i give you a big compliment.  "You are great! Thank you for the solution you give me for that irritating sound"! Because it is gone now. And i asked  to you: What is responsible for it? Is it e.Handled = true and e.SuppressKeyPress = true? Can you give me a little explanation?

    Then your question about why i attempt to try creating a Windows Form with an old Style Form. Well, i assumed that it was the common way to create a Form. Just by using the property out of the property box. Or by coding the property you need. I have never read or hear something about it that it was changed. So i thought that everthing stays in the same way. i realise out of your writing that it will be possible by difficult code. For example with using a UserControle in a Namespace and Class construction. I have tried that. The usercontrole can be make 3D. But that is simulation of the real 3D borders. I suppose.

    You know Karen, i am so eager to bring my design back to the situation like it was in Windows 7, that i try to search in every corner and place to find something. And so i finally asked it you or the others of this platform. If there is a way to bring back the Form to real 3D without color changing of the  titlebar by losing focus, then i am realy very greatfull. I was so proud on my design in Windows 7. And that is gone now. So if you know a way, please let me know it. If you wish.

    If you are living in the Cupertino time, then have a nice mornig. But if you live in the New York time then have a nice afternoon,

    Regards,

    Willem.

    Wednesday, February 14, 2018 6:57 PM
  • Hi Karen,

    You may ask me a lot. But before i answer it, i give you a big compliment.  "You are great! Thank you for the solution you give me for that irritating sound"! Because it is gone now. And i asked  to you: What is responsible for it? Is it e.Handled = true and e.SuppressKeyPress = true? Can you give me a little explanation?


    Hallo Willem,

    It is maybe the result of the way persons are currently asking things in the forums. But I'm curious. Why do people ask this. It is so simple to try. Are they maybe end users who found a program and want to do something with it?


    Success
    Cor


    • Edited by Cor Ligthert Wednesday, February 14, 2018 7:02 PM
    Wednesday, February 14, 2018 7:02 PM
  • In the case for removal of the ding sound, Handles property when set to true indicates that (in this case) ENTER key is not passed the key press events to the underlying Win32 text box control. SuppressKeyPress when set to true means the keyevent should not be passed to the underlying control.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, February 14, 2018 7:34 PM
    Moderator
  • Hallo Cor,

    Finally we are all end users of a product made by Microsoft. You know, working in a company means that you have colleagues. What one not knows, knows a other. The tricks pass from colleague to colleague. In that situation the people on the workfloor  learn day by day more about coding. In that way you can look to the working and meaning of platforms. Not everthing you can find in books. Sometimes you need others to grow in experience. And you are in that situation to do that. You must be proud on yourself.

    Hi Karen,

    Thank you for your explanation! And lesson.

    Regards,

    Willem.

    Thursday, February 15, 2018 10:10 AM
  • Hi HofsteeWillem,

    If your issue has been resolved now? If yes, please remember to close your thread by marking the helpful post as answer, it is beneficial to other community members who face the same issue.

    Thanks for your understanding.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 1, 2018 9:16 AM
    Moderator
  • Hi Karen,

    You may ask me a lot. But before i answer it, i give you a big compliment.  "You are great! Thank you for the solution you give me for that irritating sound"! Because it is gone now. And i asked  to you: What is responsible for it? Is it e.Handled = true and e.SuppressKeyPress = true? Can you give me a little explanation?

    Then your question about why i attempt to try creating a Windows Form with an old Style Form. Well, i assumed that it was the common way to create a Form. Just by using the property out of the property box. Or by coding the property you need. I have never read or hear something about it that it was changed. So i thought that everthing stays in the same way. i realise out of your writing that it will be possible by difficult code. For example with using a UserControle in a Namespace and Class construction. I have tried that. The usercontrole can be make 3D. But that is simulation of the real 3D borders. I suppose.

    You know Karen, i am so eager to bring my design back to the situation like it was in Windows 7, that i try to search in every corner and place to find something. And so i finally asked it you or the others of this platform. If there is a way to bring back the Form to real 3D without color changing of the  titlebar by losing focus, then i am realy very greatfull. I was so proud on my design in Windows 7. And that is gone now. So if you know a way, please let me know it. If you wish.

    If you are living in the Cupertino time, then have a nice mornig. But if you live in the New York time then have a nice afternoon,

    Regards,

    Willem.

    Hello Willem,

    I believe this reply was off my radar. I'm at Microsoft this week, if I get a chance will ask one of the project managers (I know one) if this is possible.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, March 7, 2018 2:29 PM
    Moderator
  • Hi Karen,

    Your last reply was also off my radar too. It was March 7, and now it is July 22. How was it by Microsoft? Have you ask it to the project manager, who you did kwow? And what was his answer?

    I have also think a lot. And i came on the idea to make(create/develop) a Form by myself. With the use of Windows.Drawing and Windows.VisualStyles. And make my own property window for it. Maybe it will work. If i have finished the project, i start with experimenting. You know, the Windows Form exist of 2 squares. One inside and one outside. When you bring the top line of the inside square so, that a space remains between the top line of the outside square, then you have a titlebar. The same you can do with the right and left lines. So that you get borders. And that was the way how M.S. build up the Window Form at the time of Windows 7. With color effect you get deepness and highness effects. The problem Microsoft found at the time that they will change the titlebar color into dark grey, with White characters ,was that the titlebar belongs to the outside square. Changing color of the titlebar, did change the color of the whole outside square. So they changed the widthness of the inside square so, that the lines of the inside square and outside square, where falling upon each other. Left side and right side. In that situation you can't use fixed3D and prefend loosing focus properties. And so M.S. has solved  one problem, and shaped new ones.

    And now i have a problem with the webbrowser and the webbrowser document type name. So i am searching and reading and trying for weeks now. If you are interested, i will give you my target.

    Best regards,

    Willem.

    Sunday, July 22, 2018 7:05 PM