
dynamic_sysop
Leaders
-
Posts
1044 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by dynamic_sysop
-
How to set the selection fontstyle of a richtextbox?
dynamic_sysop
replied to Erikvandervelde's topic in Windows Forms
almost forgot the Bold bit. rtfChannel.SelectionFont = New System.Drawing.Font(read_font, 10.0!, FontStyle.Bold) '// read_font is where your font would be btw. hope this helps , the richtextbox control is quite good in .net once you get used to it :) -
How to set the selection fontstyle of a richtextbox?
dynamic_sysop
replied to Erikvandervelde's topic in Windows Forms
With rtfChannel .SelectionStart = Len(.Text) .SelectionColor = System.Drawing.Color.SteelBlue .SelectedText = inData End With the colour bit being this ... rtfChannel.SelectionColor = System.Drawing.Color.SteelBlue rtfChannel being the richtextbox.:) oops and the Font ? rtfChannel.SelectionFont = New System.Drawing.Font("Tahoma", 10.0!) -
maybe something like this. Dim f as Integer '// number of functions to use. Dim i as Integer For i = 1 to f '/// do the function System.Threading.Thread.Sleep ' time to sleep Next i not tried it , but it seems logical ( and a similar principle works fine in vb6 )
-
System.Threading.Thread.Sleep ' time in milliseconds '// eg: System.Threading.Thread.Sleep(10) just incase you havent used the Threading Sleep function before :)
-
listview subitems / images ? is it possible?
dynamic_sysop
replied to dynamic_sysop
's topic in Windows Forms
i know we dont show vb6 code on here but just to show how straightforwards it is / was in vb6 to add subitem icons... If Len(SName) > 1 Then Set strItem = frmClient.lvwYou.ListItems.Add(, SName, SName & " " & UnConverted, , ReturnIcon)'// this is the normal icon strItem.ListSubItems.Add , , strNick, ProfIcon'// this is the subitem icon ProfIcon = 0 End If you can set the first column to 0 width so it doesnt show , then you only see the subitem row eg: row 1 --------------- row2 (icon) @Dynamic (icon) Dynamic with ^^ set to 0 it'd show as this... row2 (icon) Dynamic and stay sorted according to row1:) -
or if you want a standard ( none mdi form ) within another standard form try the winapi with this. Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long setting the parent for Form2 as Form1 will put Form2 inside it:) another alternative to try.
-
it's ok i sussed it , my silly mistake:-\ Dim tp As New ToolTip() With ListView1 .Items.Add(TextBox1.Text) tp.SetToolTip(ListView1, TextBox1.Text) End With End Sub was using .Text before ( as in the listitem ) but obviously that was blank.
-
someone must know how to add a tooltip to an item in a listview:-\ in vb6 i'd just tell it to set the listview.listitems(i).tooltiptext but there's no mention of tooltips in .net
-
hi does anyone know how to put a tooltip on a listview item? i've tried this... Dim tp As New ToolTip() With ListView1 .Items.Add(TextBox1.Text) tp.SetToolTip(ListView1, .Text) End With but it does nothing:-\ and there's no direct tooltip feature on the listview control by the look of it. cheers
-
<StructLayout(LayoutKind.Sequential)> _ Public Structure HITTESTINFO Dim pt As POINTAPI Dim flags As Long Dim iItem As Long Dim iSubItem As Long End Structure <StructLayout(LayoutKind.Sequential)> _ Public Structure LV_ITEM Dim mask As Long Dim iItem As Long Dim iSubItem As Long Dim state As Long Dim stateMask As Long Dim pszText As String Dim cchTextMax As Long Dim iImage As Long Dim lParam As Long Dim iIndent As Long End Structure then i'm having to use SendMessage this way... Public Declare Function SendMessage Lib "user32" Alias "SendMessageW" (ByRef hWnd As Integer, ByRef wMsg As Integer, ByRef wParam As Integer, ByRef lParam As Object) As Integer because if i use the "<dllimport("user32�)> _" and "Shared Function" method, i get an error in this line .... Protected Overrides Sub WndProc(ByRef uMsg As System.Windows.Forms.Message) RaiseEvent WindowProcedure(uMsg) MyBase.WndProc(uMsg)'//// ERROR HERE " NULL" End Sub :confused:
-
1 other thing, i'm trying to use SendMessage to carry out the HITTEST Public Structure HITTESTINFO Dim pt As POINTAPI Dim flags As Long Dim iItem As Long Dim iSubItem As Long End Structure Public Sub sClass_WindowProcedure(ByRef uMsg As Message) Handles sClass.WindowProcedure Select Case uMsg.Msg Case WM_LBUTTONDOWN Dim hdr As HITTESTINFO Dim l As Integer Dim x, y As Integer With hdr .pt.x = uMsg.LParam.ToString Mod 65536 .pt.y = uMsg.LParam.ToString \ 65536 End With l = SendMessage(uMsg.HWnd.ToInt32, LVM_HITTEST, 0, hdr) Addit(l) '/// show the currently selected listitem number in a textbox end sub all i seem to get is the value "0" no matter which item i HITTEST can i still use SendMessage or is there an alternative way?
-
cheers it works great ,this is really weird , when i posted the message to start with this is a snippet... the lParam at the time of posting was 655361 , so when i saw you put 65536 i was putting the current lParam there , but it turns out 655361 & 65536 are 2 totally different things lol. what are the chances of getting an lParam and posting it and then finding out the function you need to use to get the co-ordinates of the mouse are identical to that lParam apart from a 1 :-\ . cheers for the help guys:D
-
the code to convert to the position returns this x = 0 y = 0 no matter where i click :-\ Public Sub sClass_WindowProcedure(ByRef uMsg As Message) Handles sClass.WindowProcedure Select Case uMsg.Msg Case WM_LBUTTONDOWN Dim l As Int32 ' <<< this i tried as integer and Long Dim x, y As Integer x = l Mod uMsg.LParam.ToInt32 y = l \ uMsg.LParam.ToInt32 Addit("x = " & x & " y = " & y) ' Addit("Message: WM_LBUTTONDOWN " & " : " & uMsg.Msg.ToString & " - wParam " & uMsg.WParam.ToInt32 & " - lParam " & uMsg.LParam.ToInt32 & " ") Case WM_MOUSEMOVE Addit("Message: WM_MOUSEMOVE " & uMsg.Msg.ToString & " - wParam " & uMsg.WParam.ToString & " - lParam (mouse point on parent hWnd) " & uMsg.LParam.ToString) Case WM_PAINT Addit("WM_PAINT " & uMsg.Msg.ToString & " - wParam " & uMsg.WParam.ToInt32 & " - lParam " & uMsg.LParam.ToInt32) End Select End Sub when i receive the WM_LBUTTONDOWN or mouse move, i need the exact co-ordinates for the Hittest that i wish to carry out , but all i get back is zero's. someone must have an idea how i can get the co-ords ( zero being left / top of the subclassed item ie: the listview , not the co-ords of the form )
-
what would that equate to? or should i say how do i do the above:-\ is l a long or an integer or something and is the "Mod" an expresion? cheers.
-
hi could someone tell me if it's possible to convert a Long to the co-ordinates of the mouse within an item ( eg: i have a listview subclassed in vb.net and when i click on an item in it , i want the co-ordinates like 10 = x , 15 = y ) when i view the lParam for mouse move i get this for the values... Message: WM_MOUSEMOVE 512 - wParam 0 - lParam (mouse point on parent hWnd) 655361 the "655361" being the mouse co-ordinates , but in vb6 i'd get this Message: WM_MOUSEMOVE 512 - wParam 0 - lParam (mouse point on parent hWnd) 327690 the "327" being x=8 , the "690" being y=10 i need to get the exact co-ords so that i can then carry out a HITTEST followed by a LVM_GETITEMTEXT cheers.
-
subclassing? the "lParam" value.
dynamic_sysop
replied to dynamic_sysop
's topic in Interoperation / Office Integration
i subclass in vb6 yes , but i'm having a bit of a headache with something so i thought i'd try with .net. cheers -
subclassing? the "lParam" value.
dynamic_sysop
replied to dynamic_sysop
's topic in Interoperation / Office Integration
s'ok i may have an idea now :) msg.LParam ( msg being the main message received ) 1 thing tho, does the lParam have to be converted to a long or an IntPtr ? ( what ever an IntPtr is :-\ , a pointer to an integer at a guess ) -
subclassing? the "lParam" value.
dynamic_sysop
posted a topic in Interoperation / Office Integration
hi i know that to grab events using subclassing in vb.net you can get the msg value ( using ByRef m As Message ) but is it possible to get the other parts, like wParam and lParam ? i'm just wondering as without them bits the subclass seems a bit useless:-\ . i want to hook a window and view all messages that pass through it , but all i seem to get is the "message" eg : WM_PAINT. i'm already aware that i cant use the AddressOf function as in vb6 ( it says cant use a reference to a long or something ) any ideas on how to be able to watch the other params would be great. all i can find is this ... System.Windows.Forms.Message which represents the actuall message . -
just make sure "hide Selection" is set to false:) then it wont scroll off the page.
-
well i use this way, not sure if it'll help you '// at the top of your form. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Const SLEEPTIME as Long = 100 ' what ever time you want in milliseconds goes here '// then in the area you want to use the code, i'd use this... Sleep SLEEPTIME hope this helps.
-
can a vb.net dll be used in vb6?
dynamic_sysop
replied to dynamic_sysop
's topic in Interoperation / Office Integration
it's ok, i found what it was "tlbexp.exe" not "tlbimp.exe" :) cheers -
can a vb.net dll be used in vb6?
dynamic_sysop
replied to dynamic_sysop
's topic in Interoperation / Office Integration
thanx , although it hasn't made a .tlb file ( only still got the Dll , which still wont reference in vb6 :S ) -
hi again , i'm trying to impliment a "SetWindowLong" in vb.net , however i need to use the "AddressOf NewWindowProc" , but i get an error that it cant convert an "AddressOf" to a long:confused: is there an equivalent in Dot Net? my test to see if i could get it to work ( in a module ) is this... Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Try Select Case msg Case WM_NCPAINT Debug.Write("WM_PAINT " & wParam) Case WM_LBUTTONUP Debug.Write("WM_LBUTTONUP " & wParam) Case Else NewWindowProc = CallWindowProc(OldWindowProc, hwnd, msg, wParam, lParam) End Select DefWindowProc(hwnd, msg, wParam, lParam) Catch Debug.Write("An Error has occurred") End Try End Function and on the form ( in a button_click ) this... OldWindowProc = SetWindowLong(TextBox1.Handle.ToInt32, GWL_WNDPROC, " THIS IS WHERE THE ADDRESSOF SHOULD GO")'// HERE IT SAYS THAT I CANT USE ADDRESSOF any help appreciated thanx.
-
can a vb.net dll be used in vb6?
dynamic_sysop
posted a topic in Interoperation / Office Integration
hi i read on a couple of sites that you can make a dll in VB.NET and reference it in vb6, does anyone know if this is possible and if so, have you any idea on how to? thanx.:) -
hi , has anyone got a way of adding images to a listview subitem? over the months i've grown to like vb.net over vb6 in many ways, but i think that the listview seems a retrograde step:-\ , when i make an irc client in vb6 i can add an unconverted nickname to the main list ( leaving the "." or "@" for a host or owner as this keeps them at the top of the list ) then i add the converted name ( minus the "." or "@" ) with the corisponding icon for a host or owner next to it [ this is added as a subitem ] i set the first list to 0 wide so it's hidden and then fullrow select to On. this allows me to show hosts etc kept at the top without all the messy dots and @ signs..... now vb.net arrrrrrrrrrrgh, it wont allow me to add images to the subitems, so i'm stuck with the dot's and @ signs ( unless i set the first row to 17 wide to show an icon and then the second row as the main row ( but this looks messy because of the gap between the icons and text ) is there any way at all to add the icons or if it's not possible to hide the first char ( eg: the "." or "@" ) from view in the first row? any help would be appreciated ty.:)