-
Feb 2nd, 2021, 10:02 AM
#1
Thread Starter
Junior Member
.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.
-
Feb 2nd, 2021, 01:31 PM
#2
Re: .NET 5 - no listview scrollbars on deployed version
-
Feb 2nd, 2021, 05:55 PM
#3
Thread Starter
Junior Member
Re: .NET 5 - no listview scrollbars on deployed version
It says Win 7 SP1 above and Win 10 supported.
-
Feb 2nd, 2021, 07:07 PM
#4
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.
-
Feb 3rd, 2021, 02:52 AM
#5
Thread Starter
Junior Member
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!
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.
But searching for same word in .NET 5 provides this result - all over the place! I tried with multiple examples with same result.
-
Mar 2nd, 2021, 03:56 PM
#6
New Member
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
-
Mar 3rd, 2021, 03:04 AM
#7
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|