I have a listview that I want to align the icons so that it only goes horizontal and will be able to scroll that way..not vertical. Any way to do this in vb.net?
lespaul36
Posts
-
Align ListView Items -
Icon In ListView Header .NetI have this code that I found, but I keep getting a Nullreference error. Declarations
Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" _ (ByVal hwnd As IntPtr, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As HD_ITEM) As Long Const LVM_FIRST = &H1000 Const LVM_GETHEADER = (LVM_FIRST + 31) Const HDI_BITMAP = &H10 Const HDI_IMAGE = &H20 Const HDI_FORMAT = &H4 Private Const HDI_TEXT = &H2 Private Const HDF_BITMAP_ON_RIGHT = &H1000 Private Const HDF_BITMAP = &H2000 Private Const HDF_IMAGE = &H800 Private Const HDF_STRING = &H4000 Private Const HDM_FIRST = &H1200 Private Const HDM_SETITEM = (HDM_FIRST + 4) Private Const HDM_SETIMAGELIST = (HDM_FIRST + 8) Private Const HDM_GETIMAGELIST = (HDM_FIRST + 9) Private Structure HD_ITEM Dim mask As Integer Dim cxy As Integer Dim pszText As String Dim hbm As Integer Dim cchTextMax As Integer Dim fmt As Integer Dim lParam As Integer Dim iImage As Integer Dim iOrder As Integer End Structure
Dim hHeader As IntPtr = ShellDll.SendMessage(lstView.Handle, Win32.WindowsMessages.LVM_GETHEADER, 0, 0) Dim lvImage As IntPtr = ShellDll.SendMessage(hHeader, Win32.WindowsMessages.HDM_SETIMAGELIST, 0, CInt(Me.imgArrows.Handle.ToInt32)) Dim lret As IntPtr For i As Integer = 0 To lstView.Columns.Count - 1 'Use the LVM_SETCOLUMN message to set the column's image index. Dim HD As New HD_ITEM Dim pblnAlignRight As Boolean With HD .mask = HDI_IMAGE Or HDI_FORMAT .pszText = lstView.Columns(i).Text End With If lstView.Columns(i).TextAlign = HorizontalAlignment.Right Then pblnAlignRight = True Else pblnAlignRight = False End If If i = ColumnIndex Then With HD .fmt = HDF_STRING Or HDF_IMAGE Or HDF_BITMAP_ON_RIGHT .iImage = IconIndex End With Else HD.fmt = HDF_STRING End If SendMessage(hHeader, HDM_SETITEM, i, HD)'error occurs here Next
-
Column Color ChangeFound how to do it. Friend Const LVM_SETSELECTEDCOLUMN As Integer = (LVM_FIRST + 140) SendMessage(lstView.Handle, Win32.WindowsMessages.LVM_SETSELECTEDCOLUMN, ColumnIndex, 0) lstview.invalidate()
-
Icon In ListView Header .NetI have been trying to get my listview to show an icon on the right side of the header if that column has been clicked. So far I have had almost no luck. Any links to one would be great. Showing code would be good too. I know I had found one once, but I can not find it again. Thanks
-
Flat file systemThere is also MySQL wich is becoming widely used and Free.
-
Picture from videoI think I posted this before, but I have searched and not found the post. I want to extract a bitmap from a mpg, avi, etc. Any ideas? TIA
-
Custom Draw ListViewFigured it out...use a imagelist and set the imagelist image size to the size I need
-
Closing FromI have started a project to do it. I am overriding WndProc and catching some of the messages. I am having trouble figuring out which ones though. I have this so far.
MyBase.WndProc(m) Select Case m.Msg Case Is = Win32.WindowsMessages.WM_QUERYENDSESSION f = New UnloadModeEventArgs(ECloseMode.AppWindows, False) Case Is = Win32.WindowsMessages.WM_SYSCOMMAND If m.WParam.ToInt32 = Win32.WindowsMessages.SC_CLOSE Then f = New UnloadModeEventArgs(ECloseMode.FormControlMenu, False) End If End Select
-
Closing FromThe form QueryUnload has a variable called UnloadMode As Integer that could be used to tell you where the unload was called..check it out. It seems they removed this in .Net, bummerr.
-
Closing FromI remember that in vb6 there was a way to get where a form close was called from (ie. clicked x, computer shut down etc.) Is there a way to get this in .net.
-
OnPaintBackGround ListViewI am recreating a Windows Explorer control. I am stuck at making the selected column (when in details view) have a different color. I was hoping that maybe I could paint the rectangle when the packground was painted and the items would still paint alright. I am just trying about anything I can think of or find close on the internet.
-
OnPaintBackGround ListViewI wanted to override the onpaintbackground of my listview control, but it never seems to be invoked. Is there a way I can cause it to invoke..maybe getting a message from WndProc. If so, what message?
-
and asp.net Starting new jobMay consider taking a course at you local junior college. And take a look at you local book stores. Also, for ASP.Net check out www.asp.net. But, there is alot to learn. Working with asp uses C#/VB.Net, HTML, and JavaScript.
-
Dial-Up connection In .Netcheck out InternetDial function of wininet.dll. I haven't found exact usage, but I am needing to do this also.
-
How to draw lines then undo ???Have to tuck this away for the next time I am messing with GDI+. Thanks T-Smooth.
-
calling back a previous form..I have had a few times when it was necessary to hide form1 and then make it visible again when form2 closed. I found that it didn't always become visible again. Probably a focus issue and I have not had to deal with that very much in vb.net. While I agree that it is a dirty way of doing it, it worked.
-
Masked BoxesI think there is one that someone made on this site. I know I have seen one somewhere..google it.
-
How to access a TextBox control if given its Name as a variable?Was the textbox put on the form at runtime or designtime. if it was as designtime then use the control name and not the variable to access it. Otherwise, I would put a form level variable of type textbox to hold it. If there are going to be alot of runtime controls added, make an arraylist and add them to that. However, the only way I know of to get the control in this case is:
Dim tb as TextBox For Each tb in me.Controls If tb.Name=str Then exit For End If Next
tb should be the TextBox you want. -
How to draw lines then undo ???I did something like this before, without the selection of a line to remove it. I wish I had the code, but I lost it when I had a hard drive crash (back up every week now :) ) I used GetChildAtPoint for some of the info. I also used an array of bitmaps, however it was for icon info (never did get it to make actual ico files instead of png files), so it was fast and didn't use too much resources. You could probably still pull it off, but might have to do some playing. I would be interested to see if there is a hittest or something for a drawn line...please let me know back. Other wise you would probably want to write the routine to check if it is a hit in its own thread and you would need to give a little distance for ease of click...be hard if it had to be a certain pixel). Good Luck
-
How to draw lines then undo ???Haven' had to do much more that d += 1 lately. :-D