none
VS17 the TextBox.ReadOnly = TRUE seems to allow CTRL-V to Paste in the field. RRS feed

  • Question

  • I have and Issue where I have set a Textbox.ReadOnly = TRUE and it does stop you from typing into the field.  But it also allows for you to Paste into it still.  I saw that they had fixed this in VS12, but have they reintroduce it back in?  I don't want to use the ShortCutsEnabled = FALSE as that effects the whole screen and not just the ones I am concerned with.  I am in VS17 using VB.
    Thursday, September 14, 2017 7:10 PM

All replies

  • Hi

    Can't reproduce that here.

    Using same VS as you and a TextBox with ReadOnly = True (and all other Properties are Defaults) doesn't accept a Ctr-V (Paste) at all. The Context Menu Paste is also greyed out for the TextBox.


    Regards Les, Livingston, Scotland



    • Edited by leshay Thursday, September 14, 2017 7:23 PM
    Thursday, September 14, 2017 7:20 PM
  •  I also can not re-produce the problem.  Ctrl+V is blocked for me.  I am using VS2015 and targeting .Net Framework 4.5.2 with the project.

    If you say it can`t be done then i`ll try it

    Thursday, September 14, 2017 7:39 PM
  • the Cut and Paste lines don't show up my the Context Menu, so it is baffling me why, I wonder if its the fact it's also a Web Application?

      
    Thursday, September 14, 2017 7:39 PM
  • Just in case I will pass this along also

    our Target framework is 4.6.1 

    Visual Studio Community 2017, 15.3.4

    Microsoft Visual Studio Community 2017
    Version 15.3.4
    VisualStudio.15.Release/15.3.4+26730.15
    Microsoft .NET Framework
    Version 4.7.02046
    Installed Version: Community
    Visual Basic 2017   00369-60000-00001-AA690
    Microsoft Visual Basic 2017
    Visual C# 2017   00369-60000-00001-AA690
    Microsoft Visual C# 2017
    Visual C++ 2017   00369-60000-00001-AA690
    Microsoft Visual C++ 2017
    Visual F# 4.1   00369-60000-00001-AA690
    Microsoft Visual F# 4.1
    Application Insights Tools for Visual Studio Package   8.8.00712.1
    Application Insights Tools for Visual Studio
    ASP.NET and Web Tools 2017   15.0.30726.0
    ASP.NET and Web Tools 2017
    ASP.NET Core Razor Language Services   1.0
    Provides languages services for ASP.NET Core Razor.
    ASP.NET Template Engine 2017   15.0.30726.0
    ASP.NET Template Engine 2017
    ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
    For additional information, visit https://www.asp.net/
    Azure App Service Tools v3.0.0   15.0.30728.0
    Azure App Service Tools v3.0.0
    Azure Data Lake Node   1.0
    This package contains the Data Lake integration nodes for Server Explorer.
    Azure Data Lake Tools for Visual Studio   2.2.9000.1
    Microsoft Azure Data Lake Tools for Visual Studio
    Azure Data Lake Tools for Visual Studio   2.2.9000.1
    Microsoft Azure Data Lake Tools for Visual Studio
    Common Azure Tools   1.10
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
    Cookiecutter   3.0.17240.1
    Provides tools for finding, instantiating and customizing templates in cookiecutter format.
    Fabric.DiagnosticEvents   1.0
    Fabric Diagnostic Events
    JavaScript Language Service   2.0
    JavaScript Language Service
    JavaScript Project System   2.0
    JavaScript Project System
    JavaScript UWP Project System   2.0
    JavaScript UWP Project System
    JetBrains ReSharper Ultimate 2017.1.3    Build 108.0.20170613.154143
    JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.
    Microsoft Azure HDInsight Azure Node   2.2.9000.1
    HDInsight Node under Azure Node
    Microsoft Azure Hive Query Language Service   2.2.9000.1
    Language service for Hive query
    Microsoft Azure Service Fabric Tools for Visual Studio   1.7
    Microsoft Azure Service Fabric Tools for Visual Studio
    Microsoft Azure Stream Analytics Language Service   2.2.9000.1
    Language service for Azure Stream Analytics
    Microsoft Azure Stream Analytics Node   1.0
    Azure Stream Analytics Node under Azure Node
    Microsoft Azure Tools   2.9
    Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1
    Microsoft Continuous Delivery Tools for Visual Studio   0.3
    Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.
    Microsoft JVM Debugger   1.0
    Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
    Microsoft MI-Based Debugger   1.0
    Provides support for connecting Visual Studio to MI compatible debuggers
    Microsoft Visual C++ Wizards   1.0
    Microsoft Visual C++ Wizards
    Microsoft Visual Studio VC Package   1.0
    Microsoft Visual Studio VC Package
    NuGet Package Manager   4.3.1
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    Office Developer Tools for Visual Studio 2017 ENU   15.0.26712
    Microsoft Office Developer Tools for Visual Studio 2017 ENU
    Python   3.0.17240.1
    Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
    Python - Django support   3.0.17240.1
    Provides templates and integration for the Django web framework.
    Python - IronPython support   3.0.17240.1
    Provides templates and integration for IronPython-based projects.
    Python - Profiling support   3.0.17240.1
    Profiling support for Python projects.
    R Tools for Visual Studio   1.1.30817.1931
    Provides project system, R Interactive window, plotting, and more for the R programming language.
    SQL Server Data Tools   15.1.61707.200
    Microsoft SQL Server Data Tools
    Syncfusion Web Conversion and Migration   15.3.0.26
    Converts and migrates a web project into a Syncfusion web project.
    Syncfusion.VSExtension.Troubleshooter   15.3.0.26
    Add-in for Troubleshooting the Syncfusion projects.
    ToolWindowHostedEditor   1.0
    Hosting json editor into a tool window
    TypeScript   2.3.4.0
    TypeScript tools for Visual Studio
    Visual Studio Code Debug Adapter Host Package   1.0
    Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
    Visual Studio Tools for Unity   3.3.0.2
    Visual Studio Tools for Unity
    Visual Studio Tools for Universal Windows Apps   15.0.26730.08
    The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
    WebJobs Tools v1.0.0   15.0.30901.0
    WebJobs Tools v1.0.0
    Workflow Manager Tools 1.0   1.0
    This package contains the necessary Visual Studio integration components for Workflow Manager.

    Thursday, September 14, 2017 8:09 PM
  • the Cut and Paste lines don't show up my the Context Menu, so it is baffling me why, I wonder if its the fact it's also a Web Application?

      

    Hi Stephan,

    I also can not reproduce your issue, my Visual Studio is also 2017 and target framework is 4.6.1. When I set TextBox readonly property as false, I cannot input anything or paste anything.

    I don't understanding your sentence, what is your mean? 

    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.

    Friday, September 15, 2017 5:48 AM
    Moderator
  • Stephen,

    What kind of Textbox. I think that you can use with VB thousands of controls with the name "Textbox". 

    Default is here assumed that without name the one in Windows Forms is used. 


    Success
    Cor

    Friday, September 15, 2017 6:02 AM
  • If I right click on the field the menu drops down and cut or paste is not in the menu.  but if you do Ctrl-v it paste's anyways.  Is this something with Chrome kicking in maybe?
    Friday, September 15, 2017 12:58 PM
  • You are correct, this is the one that ships with Visual Studio from MS.  I am beginning to think that Chrome or the browser maybe causing this.
    Friday, September 15, 2017 1:00 PM
  • If I right click on the field the menu drops down and cut or paste is not in the menu.  but if you do Ctrl-v it paste's anyways.  Is this something with Chrome kicking in maybe?

    Stephan,

    It is always difficult to reply if somebody asks something, but it seems an ASP.Net textbox which is OT in this forum. 

    http://forums.asp.net


    Success
    Cor

    Friday, September 15, 2017 1:00 PM
  • Sorry, I thought that I was in the right forum.
    Friday, September 15, 2017 1:04 PM
  • If I right click on the field the menu drops down and cut or paste is not in the menu.  but if you do Ctrl-v it paste's anyways.  Is this something with Chrome kicking in maybe?

    Hi Stephan,

    What is your project, asp.net or other? Do you use Chrome in your project?

    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.

    Wednesday, September 20, 2017 9:09 AM
    Moderator