Results 1 to 7 of 7

Thread: .NET 5 - no listview scrollbars on deployed version

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2021
    Posts
    31

    Question .NET 5 - no listview scrollbars on deployed version

    I am facing a strange problem with .NET 5 ListView.
    My set up is VS2019 and .NET 5 WinForm application.

    In my dev PC, running on Windows 10, it is showing the vertifical as well as horizon scroll bars.

    After I published the single file EXE (i.e. the deployed version), I tested in 3 different PCs.

    [1] same dev PC, showing both horizontal and vertical scroll bars
    [2] Windows 10 = no scrollbars showing
    [3] Windows 7 = no scrollbars showing

    I have enough items in list view that goes beyond visible list area - so scroll bars (especially vertical one) should appear, yet neither horizontal nor vertical scroll bar appearing!

    So any computer except the development machine, the listview scrollbars not showing up.

    Any idea?

    PS: It is only happening with .NET 5, not with .NET Framework.

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,684

    Re: .NET 5 - no listview scrollbars on deployed version

    Have you checked the versioning of the OS?
    https://github.com/dotnet/core/blob/...upported-os.md

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2021
    Posts
    31

    Re: .NET 5 - no listview scrollbars on deployed version

    It says Win 7 SP1 above and Win 10 supported.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: .NET 5 - no listview scrollbars on deployed version

    Your application in targeting .NET Core so are the required libraries on the other machines? Either you need to deploy the required libraries with your app or .NET 5.0 needs to be installed on those machines. If you're deploying just the EXE, you are presumably relying on the latter.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 2021
    Posts
    31

    Re: .NET 5 - no listview scrollbars on deployed version

    I have used the following command deploye the single file executable. The size of EXE is 150 MB. An equivalent EXE under .NET Framework is only 1 MB. When I tried with "trim" command the EXE was 84 MB but it simply refused to execute in other PCs.

    dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true

    There are other bugs in .NET 5 too. For example, consider this code - which highlights words in Rich Text Box. This code is from this very site.

    Code:
    	'Source: vbforums.com/showthread.php?776231-GUIDE-Syntax-Highlighting-in-RichTextBox
    	Dim tokens As String = InputBox("Enter words to find and highlight - separated by |", "Find and Highlight")
    	Dim rex As New Regex(tokens)
    	Dim mc As MatchCollection = rex.Matches(rtb.Text)
    	Dim mrtb As New RichTextBox
    	mrtb.Rtf = rtb.Rtf
    	Dim StartCursorPosition As Integer = mrtb.SelectionStart
    	For Each m As Match In mc
    		Dim startIndex As Integer = m.Index
    		Dim StopIndex As Integer = m.Length
    		mrtb.[Select](startIndex, StopIndex)
    		mrtb.SelectionBackColor = Color.Turquoise
    		mrtb.SelectionStart = StartCursorPosition
    		mrtb.SelectionBackColor = Color.White
    	Next
    	rtb.Rtf = mrtb.Rtf
    In .NET 4.0 this code is working as expected. In .NET 5 it is highlighting wrong words!

    Name:  4h.jpg
Views: 189
Size:  33.4 KB

    This is when I search for "table" in the document. The document was created in .NET 4 then updated in .NET 5, so table format is lost in .NET 4. But still .NET 4 finding all instances of the words is working as expected.

    Name:  5h.jpg
Views: 193
Size:  41.2 KB

    But searching for same word in .NET 5 provides this result - all over the place! I tried with multiple examples with same result.

  6. #6
    New Member
    Join Date
    Mar 2021
    Posts
    1

    Re: .NET 5 - no listview scrollbars on deployed version

    I am wondering, if this could be Layout problem?
    Are you using docking or anchoring somewhere on the Form, where the ListView would be affected by?

    Please note, that we (and I say we, because I work @MS on the .NET (WinForms) team) changed the Default Font for .NET (not classic Framework) WinForms Apps as well as the Default HighDpiMode (from SystemUnaware to SystemAware), and both of those settings could change the Layout so that the control's border overrun its parent's borders without you really noticing it, especially if you've designed the Form originally in .NET Framework or on a machine with a different resolution.

    If that is not the case, are you able to provide a real small repro project, because I'd love to take a look at that (please not the whole solution you're working on, just a repo which concentrate on that exact issue.)

    Thanks,

    Klaus

    PS: We just released a Video about what's new in Visual Basic for .NET 5, which I did with my colleague Kathleen at .NET Conf, and which has just been released on YouTube.
    You may find this interesting. Also, spread the work and repost! :-)

    https://www.youtube.com/watch?v=0lRVGI4eTmg

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jan 2021
    Posts
    31

    Re: .NET 5 - no listview scrollbars on deployed version

    Hello

    Yes, the listview has anchoring/docking!

    I am not at my dev PC now, so I briefly explain what I did.

    I created a simple Windows form.
    Add a menu bar on top.
    Added a split container - left/right vertical split.
    Added a texbox with anchoring on left side top.
    Added a list view on left (below the texbox) with anchor.
    Added a rich text box on right with dock.
    Added tool strip status bars - one each on left and right at the bottom.

    That's it - no other controls. When I ran on dev PC it worked fine but when deployed on different PCs I had to problem outlined in first post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width