|
-
Sep 4th, 2005, 10:09 PM
#1
Thread Starter
Hyperactive Member
listview text gets cut off
do you know when you enter alot of text in a listview, it gets cut off. I have the code to auto resize it to expand the width, but i dont want that. i want to do is expand it vertically (height-wise) so it wont get cut off. anyone know how to do this?
-
Sep 4th, 2005, 10:31 PM
#2
Addicted Member
Re: listview text gets cut off
you mean like a vertical scroll bar???
-
Sep 4th, 2005, 11:11 PM
#3
Thread Starter
Hyperactive Member
Re: listview text gets cut off
i dont want a scroll bar, inside the listivew, there are rows and columns of text, and if you enter too much text, it will get cut off. what i want to do is expand it (height-wise). it will look ugly with a scroll bar
-
Sep 4th, 2005, 11:16 PM
#4
Re: listview text gets cut off
Could you use a MsFlexgrid instead? You can set the .RowHeight property of each individual row.
-
Sep 4th, 2005, 11:30 PM
#5
Thread Starter
Hyperactive Member
Re: listview text gets cut off
hmmm, im already using listview. i already did alot of work with the listview, is it even possible to do it with the listview? if not, i will probably switch
-
Sep 4th, 2005, 11:31 PM
#6
Re: listview text gets cut off
You could probably change the height for a single row but you would have to subclass the lvw and change its height that way.
VB Code:
ListView1.ListItems(1).Height
The height is read only but it may be possible while subclassing.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 4th, 2005, 11:40 PM
#7
Thread Starter
Hyperactive Member
Re: listview text gets cut off
i dont even know what subclassing is 
im not that good in vb
-
Sep 4th, 2005, 11:43 PM
#8
Re: listview text gets cut off
A flexgrid is like a spreadsheet. Very versatile. I would only use a listview if I needed to expand and collapse rows, and now that I learned that you can do the same with a MSHFlexgrid, I don't know if I would unless the data didn't come from a database.
-
Sep 4th, 2005, 11:47 PM
#9
Re: listview text gets cut off
Subclassing is where you go a bit lower into vb programming and hook into the messagestream that receives and sends window messages from windows to and from your form. Probably too much work for this. Perhaps its best to try a duplicate project and change the listview to a grid.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 4th, 2005, 11:52 PM
#10
Thread Starter
Hyperactive Member
Re: listview text gets cut off
yea im trying to use a grid now, and i did that height the .RowHeight = blah, and the text still gets cut off. of course the height is what i want, but it get cuts off horitonzally. anyone know how to fix this?
-
Sep 4th, 2005, 11:53 PM
#11
Re: listview text gets cut off
I think there is a .wordwrap property.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 4th, 2005, 11:58 PM
#12
Thread Starter
Hyperactive Member
Re: listview text gets cut off
yup, there is, but it isnt working. text is still cut off
-
Sep 5th, 2005, 12:00 AM
#13
Re: listview text gets cut off
Hmm, maybe your going to have to manually place line breaks to make it wrap. Going to be a pain to identify where to place them.
I know the .wordwrap in a listview only works on a listview that is in Large Icon View.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 5th, 2005, 12:04 AM
#14
Thread Starter
Hyperactive Member
Re: listview text gets cut off
manually placing line breaks is okay, since i dont have that much info. how would i do that?
-
Sep 5th, 2005, 12:06 AM
#15
Re: listview text gets cut off
I set .wordwrap=true, and then used this.
VB Code:
.TextMatrix(2, 1) = "*" & vbCrLf & "1"
of course, you have to make the row height large enough for two lines.
-
Sep 5th, 2005, 12:07 AM
#16
Re: listview text gets cut off
Before you add the item or subitem you will manipulate the string with the Mid$ and Instr functions, for ex., to break the string where you specify. Tehn with parts of your string you will reatach them but place the vbNewline inbetween.
VB Code:
MsgBox "Testing" & vbNewline & "Next line." 'for ex.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 5th, 2005, 12:16 AM
#17
Thread Starter
Hyperactive Member
Re: listview text gets cut off
ahhhh... you mean like that... thanks alot. i never thought of that and it works! one more question, is it possible to color the column of text like in listview?
-
Sep 5th, 2005, 12:22 AM
#18
Re: listview text gets cut off
Yes, its in there.
VB Code:
Option Explicit
Private Sub Form_Load()
MSFlexGrid1.Row = 1
MSFlexGrid1.Col = 1
MSFlexGrid1.TextMatrix(1, 1) = "Test"
MSFlexGrid1.CellForeColor = 255 ' = "[color=red]Test[/color]"
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 5th, 2005, 12:31 AM
#19
Thread Starter
Hyperactive Member
Re: listview text gets cut off
-
Sep 5th, 2005, 12:41 AM
#20
Re: listview text gets cut off
I could only get it to change the color of the first cell in the grid. Maybe you have to move explicitly to a cell to change the color of the cell. Filling with textmatrix() doesn't do it.
-
Sep 5th, 2005, 08:46 AM
#21
Re: listview text gets cut off
Yes, correct David. Change the .Row and .Col to the dell you want to change. Then change it and move to the next.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 5th, 2005, 01:08 PM
#22
Re: listview text gets cut off
In case you ever want to use the listview this seems to work.
ListView1.Height = (ListView1.ListItems.Count + 2) * ListView1.ListItems(1).Height
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
|