
dynamic_sysop
Leaders
-
Posts
1044 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by dynamic_sysop
-
hi could someone tell me if there's an equivilant to Doevents in dotnet?
-
This was the way bucky showed me to use listview a few months ago, hope this helps Dim li As ListViewItem Dim sName As String For Each li In lvw.Items If li.Text = sName Then lvw.Items.Remove(li) ' If you only want to remove one item with that Text ' you can put an Exit For right here End If Next you can get the index from the (li) and also do anything else, like adding additional text, icons etc...
-
np :) . btw are you making an msn programme as you are using the flashing form and sound? i ask because i make msn chat bots and know a lot of people who code msn messenger bots. so if you ever get stuck just shout :)
-
ok here you go :) put this at the top of your form ( where you normally put declares etc... ) Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _ (ByVal lpszSoundName As String, ByVal uFlags As Integer) As Long Const SND_SYNC As Integer = &H0 Const SND_ASYNC As Integer = &H1 Const SND_NODEFAULT As Integer = &H2 Const SND_LOOP As Integer = &H8 Const SND_NOSTOP As Integer = &H10 Dim SoundName As String, wFlags As Integer, x As String Then this is an example of how to make it play a wav ( or midi or mp3 file ) , in this case on a command button but it can be triggered however you wish. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click SoundName = "C:\Documents and Settings\Den\My Documents\Visual Studio Projects\WindowsApplication1\beav_rap.wav" wFlags = SND_ASYNC Or SND_NODEFAULT x = sndPlaySound(SoundName, wFlags) End Sub hope this helps:)
-
Add a listview to your form, add an image list, set the listview to smallicon view and then select the imagelist as the smallicon property in listview properties, add an image to the imagelist, in this case it's got only 1 image and the index for that image is 0, then to add the text with that image next to it you do the following... ListView1.Items.Add("Message", 0) '// 0 is the image index for that particular image in the imagelist , the "Message" obviously being your own text to add to the list. hope this helps.
-
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Asc(e.KeyChar) = Keys.Return Then TextBox2.Text = TextBox1.Text e.Handled = True End If End Sub i noticed , you were putting Keys.Enter , it's keys.return you want the above code will sort you out:)
-
the KEYASCII for removing the beep is 0 ( zero ) cant think off hand what the code is to do it. i'll look through my stuff and get back:)
-
if you want the whole application to close then use this... Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed End End Sub if you want to unload just the 1 form then i'd use the way of showing the form as divil showed above "Dim frm as form" then i'd do something like... Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed Set frm = nothing End Sub
-
Ok i've made a sample for .NET , this code i made and it's not a vb6 code:) , the timer i have set to 700 in this case. Private Declare Function FlashWindow Lib "user32" _ (ByVal hwnd As Integer, _ ByVal bInvert As Boolean) As Long Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick Call FlashWindow(Me.Handle.ToInt32, True) End Sub Protected Overrides Sub OnResize(ByVal e As System.EventArgs) If Me.WindowState = FormWindowState.Minimized Then Timer1.Enabled = True Else Timer1.Enabled = False End If End Sub enjoy:)
-
Edited, see below:)
-
I put this code together quickly but, i used vb6 not .net , however i'm sure you'll get the idea... Option Explicit Dim strStart As Integer Private Sub Command1_Click() strStart = 0 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() strStart = strStart + Timer1.Interval If strStart > 2000 Then 'IF FLASH OCCURS 4 TIMES BASED ON TIMER SET AT 500 MILLI SECONDS THEN QUIT Timer1.Enabled = False Timer2.Enabled = False Else: Label1.Visible = True Timer2.Enabled = True End If End Sub Private Sub Timer2_Timer() Label1.Visible = False 'SWITCH LABEL TO HIDDEN READY FOR NEXT FLASH. Timer2.Enabled = False End Sub that basically turns on a label ( makes it visible, then after 100 milliseconds the second timer hides it again ) hope this helps:)
-
How to check if registry key exists
dynamic_sysop
replied to Winston's topic in Directory / File IO / Registry
SaveSetting doesnt allow you to tell it the location as far as "HKEY_CURRENTUSER" etc..., only allows you to create a named key, in the default place (eg: hkey_currentuser\software\visual basic\YOUR PROGRAMME NAME ) -
Integer Values for system.drawing.colors?
dynamic_sysop
replied to dynamic_sysop
's topic in Windows Forms
there isn't a colour property for a statusbar, i can colour it with an integer in the following way... Private Const SB_SETBKCOLOR As Integer = 8193'this is the numeric value for setting the colour of the statusbar Private Const SETCOLOR As Integer = 3776961'This is the actuall colour you are setting the statusbar to, the number being the colour ( eg:3776961 would return a mustard colour ) i use that in combination with the SendMessage function. however if you send a colour value as colour.red etc or system.drawing.color.red , it wont work because it needs to be a numerical value for some reason. -
How to check if registry key exists
dynamic_sysop
replied to Winston's topic in Directory / File IO / Registry
Dim strKey As Microsoft.Win32.RegistryKey strKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\MSNChat\4.0") 'This retreives the registry key ( just have to add as nessecary to it ) thats just an example of opening a registry key -
Integer Values for system.drawing.colors?
dynamic_sysop
replied to dynamic_sysop
's topic in Windows Forms
thanks Divil:) that returns a numeric value with a - like -1956007 etc... when i use MsgBox(Color.Blue.ToArgb)'Numeric for colour returned in a MessageBox , altho if i use that value to colour my statusbar it gives a different colour lol, but hey nevermind atleast it does something. -
Hi could someone tell me if it's possible to convert a system.drawing.color ( or just color ) to a numerical value ( integer ) eg: system.drawing.color.blue to it's 00100000 value http://www.geocities.com/sysop_guss/STATUS.bmp ^^^ this picture probably wont show because it's using geocities, this is a link that opens it in a new window usually ( showing an example of what i'm trying to acheive ) status bar coloured through .net you have to right click this *** and open in new window.
-
for people to use the FM20.dll , they must have microsoft office ( 98 / 2000 ) installed on their system, otherwise it wont work ( the app will crash ) , so wouldnt it be better to use the normal combo box:-\ , the only major difference with a forms 2 combo or listbox etc... is that some unicode chars show in them which wont show in the normal combo's, however in .net this is no longer a problem as the chars will show in the standard controls anyway.
-
How To have Combo with MultiColumn in Vb.Net
dynamic_sysop
replied to sjchin's topic in Windows Forms
you mean so that there's text with another column next to it, or so that there's a drop down list of text? eg: text1 | text2 text3 | text4 or: text1 text2 text3 text4 because for the drop down list i know thats a case of setting the combobox's properties to "dropdownlist", then when you do something like.... ComboBox1.Items.Add(TextBox1.Text)'Add to combobox the list gets longer as you add the text to it. -
no problem:) , btw as you probably know the numbers for size ( ie: the 10 in the indent area ) are way different to vb6. in vb6 i use 200 as a rough indent for seltext, i tried 200 in .net and there was text in the last 5 millimeters of the richtextbox, but most of the box was blank due to the size of the indent. i'm not to sure what the differences are with the sizes and if it's possible to calculate what a vb6 size is in .net but size of indent being 10 in .net, is pretty similar to size 200 in vb6.
-
you mean the selindent then? as in how far from the left of the richtextbox the text starts? if so this is an example i put together to show how the indent moves the text over... Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click RichTextBox1.SelectionStart = Len(RichTextBox1.Text) RichTextBox1.SelectionIndent = 0 RichTextBox1.SelectedText = "TEXT ON LEFT" & vbCrLf 'first set some text from the very edge of the rtf box RichTextBox1.SelectionStart = Len(RichTextBox1.Text) RichTextBox1.SelectionIndent = 10 RichTextBox1.SelectedText = "TEXT MOVED OUTWARDS" & vbCrLf 'then set some with the indent set to "10" End Sub when you click the command button, you'll first get the text at the very left of the box, then on the next row you'll get the text with a margin to the left of it. hope this helps you :)
-
Well if you use a click on label or a click of a button, it stays raised, but if you click down then drag off the label or button ( not lifting the mouse untill you leave the label / button ) then it goes back to normal.
-
in label1_MouseEnter i put the following code... ToolBarButton1.Parent.Select() that raises the toolbar ( subject to it being set to "FLAT" layout ) however making it sink again isnt as easy :S
-
Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter ToolBar1.Buttons(0).Pushed = True '#RAISE THE FIRST BUTTON ON THE TOOLBAR End Sub Private Sub Label2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label2.MouseEnter ToolBar1.Buttons(1).Pushed = True '#RAISE THE SECOND BUTTON ON THE TOOLBAR End Sub Private Sub Label1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseLeave ToolBar1.Buttons(0).Pushed = False '#SINK THE FIRST BUTTON ON THE TOOLBAR End Sub Private Sub Label2_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label2.MouseLeave ToolBar1.Buttons(1).Pushed = False '#SINK THE SECOND BUTTON ON THE TOOLBAR End Sub obviously naming the items to your own controls names...
-
Help converting simple VB6 project to .NET
dynamic_sysop
replied to DanMcNewbie's topic in Windows Forms
mouseenter and mouseleave i presume are mousedown and mouseup, if so you may recognise the names for them better now. yes those two functions are very important :) 1 thing i learnt from this very board quite some time ago now is that it's much better to code your project using .NET to start with rather than upgrading a vb6 project using a wizard, not only does this help you to understand .Net better but also it looks a lot less messy code wise. -
+ [Windows Form Designer generated code] Dim frm As New frmChild1() '^^^^ put that line just below the windows form design line ( naming the child form obviously to the name you want ) 'the next code below is one i found on this board a while back and is very good. make sure you set the parent form as ( is mdicontaner ) on the properties box Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not IsOpen(frm) Then frm.MdiParent = Me frm.Show() End If End Sub Private Function IsOpen(ByVal frm As Form) As Boolean Dim ret As Boolean, stdForm As Form ret = False For Each stdForm In Me.MdiChildren If stdForm.Name = frm.Name Then stdForm.Focus() ret = True End If Next Return ret End Function