Jump to content
Xtreme .Net Talk

dynamic_sysop

Leaders
  • Posts

    1044
  • Joined

  • Last visited

Everything posted by dynamic_sysop

  1. if you picture a Boolean then this is what's happening... first case: '/// if neither of the Booleans ( A and B ) are True If Not A And B Then '///do something because both are False End If in the second case: '/// if either a is False , or b is False If Not(a Or b) Then '///do something because either a or b are False End If hope it helps clear things a bit.
  2. you can choose OverRides or Base Class events in your code window for your form, the overrides function for say " KeyPreview " catches the windows messages for keypresses within the app before the controls do, also using " overrides " for keypreview allows you to pick up key presses such as the arrow keys, which dont get caught on events such as " KeyDown "
  3. although when i used System.Environment.SpecialFolder.Cookies i got an error, path not found ( pointing to the app's path / bin ) , thats why i pointed to the actuall name. not sure whats going on there.
  4. this should do the job ... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cookiePath() As String = Directory.GetFiles("C:\Documents and Settings\den\Cookies") '/// path to your cookies folder must go here. Dim x As Integer For x = LBound(cookiePath) To UBound(cookiePath) If cookiePath(x).Substring(cookiePath(x).Length - 4, 4) = ".txt" Then File.Delete(cookiePath(x)) End If Next End Sub hope it helps :)
  5. after a bit of messing with streams , i embedded an mp3 in to an app and successfully copied it from manifeststream to the hd. here's a quick example of how to. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim sWriter As Stream = (Me.GetType().Assembly.GetManifestResourceStream("count_down.Big Brovaz - Nu Flow.mp3")) Dim x As Integer Dim fFile As New FileStream("C:\test.mp3", FileMode.OpenOrCreate) For x = 1 To sWriter.Length fFile.WriteByte(sWriter.ReadByte) Next fFile.Close() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
  6. just tried it and yes it only works with wordwrap turned off, showing the count of lines / chars. does anyone use notepad with wordwrap off though:rolleyes:
  7. try this... Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MyBase.KeyPreview = True End Sub Protected Overrides Function ProcessKeyPreview(ByRef m As System.Windows.Forms.Message) As Boolean If m.WParam.ToInt32 = 38 Then '/// Up Arrow '/// do stuff for the up button Return True '/// stop the arrow from moving to another control. ElseIf m.WParam.ToInt32 = 40 Then '/// Down Arrow '///do stuff for the down button Return True End If End Function
  8. not alot by the look of it lol.
  9. what do the controls look like? are you looking for buttons , menus etc? maybe a chance for you to dabble in some graphics;) and... that's brightened up my day already :D , cheers divil:p
  10. i dont think you need pop3, mine is set up using http ( in outlook ) eg:
  11. how are you trying to use it? here's a couple of ways. Dim s() As String = "some text with spaces".Split(" ") '/// fill the s() array with the words that are Split by the spaces. Dim x As Integer For x = LBound(s) To UBound(s) MessageBox.Show(s(x)) Next or ... Dim StrString As String = "some text with spaces" Dim s() As String = Split( StrString , " ") Dim x As Integer For x = LBound(s) To UBound(s) MessageBox.Show(s(x)) Next both ways will work fine.
  12. of course , i never thought about Option Strict. infact if you were using C# you wouldnt even be able to type " sender.Text " i also thought it easier to put a link to msdn rather than trying to type an explanation as to how DirectCast works.
  13. rather than using DirectCast , you can also type sender.Text. eg: Private Sub ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) MessageBox.Show(sender.Text) End Sub here's an msdn article on DirectCast... DirectCast hope it helps.
  14. you can assign a value to the Tag property , eg: textboxes(x).Tag = x then use ... If textboxes(x).Tag = " value here eg: 0 " '/// do stuff End If
  15. assuming you have got the Icon embeded , try this... this.Icon=new Icon(this.GetType().Assembly.GetManifestResourceStream("over_rides_c.Icon1.ico")); /// replacing over_rides_c with your app's name.
  16. you should be using Panel.CreateGraphics() rather than just Graphics() eg: Dim graphic As Graphics = Panel1.CreateGraphics()
  17. if you mean the top-menu , here's a starting point... divil's Office XP style Menus and Toolbars if you want the side panels, try this... VoltFace's Explorer Bar XP
  18. you mean like this?... IO.File.Copy("C:\newdata.mdb", "D:\newdata.mdb")
  19. and you may not need to use Do While , rather you can use While Not rdBfr.Peak() , here's a quick example : Dim dlgO As New OpenFileDialog() With dlgO .Filter = "text|*.txt" .InitialDirectory = "D:\" If .ShowDialog = DialogResult.OK Then Dim rdBfr As New IO.StreamReader(New IO.FileStream(dlgO.FileName, IO.FileMode.Open)) While Not rdBfr.Peek '/// make sure it only reads till it gets to it's peak. txtOriginal.AppendText(rdBfr.ReadLine & Environment.NewLine) End While End If End With
  20. thats cuz it's Alt 0249 from the keyboard ;)
  21. set the font of the textbox to wingdings , then use this ... l
  22. you dont really need to even add the IO.Stream , here's 2 ways to add the new cursor.... way1 : MyBase.Cursor = New Cursor(Me.GetType().Assembly.GetManifestResourceStream("count_down.Cursor1.cur")) way2: MyBase.Cursor = New Cursor(GetType(Form1).Assembly.GetManifestResourceStream("count_down.Cursor1.cur")) hope it helps.
  23. well my little countdown app ( wonder why i'm using a countdown app :-\ ;) ) goes like this .... Private twins As String = String.Empty Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Timer1.Enabled = False End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If DateTime.Now.Hour = "10" And DateTime.Now.Minute = "30" And DateTime.Now.Second = "00" And DateTime.Now.Millisecond < 100 Then twins = "days till the birth of our twins: " twins += DateDiff(DateInterval.Day, DateTime.Now, DateTime.Parse("28/08/2003 08:00:00")).ToString MessageBox.Show(twins, DateTime.Parse("28/08/2003 08:00:00").ToLongDateString, MessageBoxButtons.OK, MessageBoxIcon.Information) twins = "" End If End Sub not sure if it helps.
  24. if you want to end your program with F11 , cant you set your KeyPreview to true, then when the key F11 gets pressed tell the app to close?
  25. no need to use the streamwriter with the richtextbox really though :) , as voltface was saying use .SaveFile , adding to that you can specify the format of the text to save , eg: RichTextBox1.SaveFile("D:\somepath.txt", RichTextBoxStreamType.PlainText)
×
×
  • Create New...