Jump to content
Xtreme .Net Talk

Machaira

Avatar/Signature
  • Posts

    330
  • Joined

  • Last visited

Everything posted by Machaira

  1. One suggestion - instead of doing: pbar.Value = ilp You can do: pbar.Increment(1) Gets rid of having a variable just to change the ProgressBar.
  2. Why not just display the percentage in the progressbar itself? :) Private Sub UpdatePBar() Dim x As Single Dim y As Single Dim percentage As String = CType((ProgressBar1.Value / ProgressBar1.Maximum * 100), Integer).ToString & "%" Dim gr As Graphics = ProgressBar1.CreateGraphics Dim sz As SizeF = gr.MeasureString(percentage, ProgressBar1.Font, ProgressBar1.Width) x = (ProgressBar1.Width / 2) - (sz.Width / 2) y = (ProgressBar1.Height / 2) - (sz.Height / 2) gr.DrawString(percentage, ProgressBar1.Font, Brushes.Black, x, y) End Sub Call this every time you update the progressbar. The only downside is that you need to call the Refresh method of the progressbar right before you call this, otherwise you get ugliness. :( It's assumed this code is in the form with the progressbar and the progressbar is named ProgressBar1. Change as necessary. :)
  3. If TextBox1.Text.IndexOf(" ") > -1 Then MessageBox.Show("Space in text") End If
  4. OK, I'm stumped. I'm trying to take the substring of a string: row.ItemArray[8]=grdInfo.Rows[1].Cells[2].Text.Substring(4); The cell has data in it - "Ion 81", so there should be no problem with getting the number part of the string out of it. However, I get the error: "grdInfo.Rows[1].Cells[2].Text.Substring does not exist". This error is returned for all the methods of the Text object, but I can access the Length property. What the...?!? The error is returned even if I assign the Text property to another string: string temp = grdInfo.Rows[1].Cells[2].Text; row.ItemArray[8]=temp.Substring(4); Any ideas? Thanks!
  5. What is an SVG file?
  6. In the example you gave where an article is archived before it expires, I would not change the expiration date. That's corrupting the data, IMO. If the article can be archived before it expires then use both fields.
  7. Sounds like you can do: pbar.Maximum = rtb.Lines.GetLength(0) Dim ilp As Integer For ilp = 0 To rtb.Lines.GetLength(0) - 1 'do formatting pbar.Value = ilp + 1 Next ilp
  8. Umm, there's no attached files.
  9. Then you must be doing something wrong. :) ;) Working with it shouldn't be any slower than a regular textbox. Can you be more specific in what the problems with it are?
  10. Start here
  11. Not unless the control supports it which, for a label, is no.
  12. The following seems to work: Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown If Not (ListView1.GetItemAt(e.X, e.Y) Is Nothing) Then ListView1.ContextMenu = mnuItem Else ListView1.ContextMenu = mnuNoItem End If End Sub
  13. I'm sending emails just fine in my ASP.NET project.
  14. Whipped it up in a couple of minutes. :) Glad it helped.
  15. The rectangle should stay there until you move the mouse.
  16. Take a look at the attached. It should give you a start. Collapsible Window.zip
  17. The IndexOf function returns a number which tells you the location of the string passed to the function in the text that's searched, in this case the text in the RichTextBox. If that number is -1 the string isn't in the text so you don't want to do the insert. Surely you can modify the code on your own. If you want someone to do your coding for you, try http://www.rentacoder.com. ;)
  18. Huh?!? :confused:
  19. Sounds like you need to stick: COpicsXMLOperations.DS_OpicsSystemBuilder.Relations.Clear(); in there before reading the file
  20. Move the part: RichTextBox1.Text.IndexOf("</head>") before the insert, storing the return value in a variable. Check the variable - if it's -1 don't do the insert.
  21. My bad. :)
  22. If you want to put the text before the "</head>" tag why would you be looking for an append function? Just because I'm a nice guy I'll give you this one :) ;) : Dim sText As String = "<style>" & Environment.NewLine & Environment.NewLine & "</style>" RichTextBox1.Text = RichTextBox1.Text.Insert(RichTextBox1.Text.IndexOf("</head>"), sText)
  23. Dim iLp As Integer Dim arr(ListBox1.Items.Count - 1) As String For iLp = 0 To ListBox1.Items.Count - 1 arr(iLp) = CType(ListBox1.Items(iLp), String) Next iLp
  24. DirectCast(TabControl1.SelectedTab.Controls(0), TextBox).Text This of course assumes you have only the textbox in each tabpage.
  25. Try: codebox.SelectedText = "<font color='" + ColorDialog.Color.ToKnownColor.ToString + "'>" + codebox.SelectedText + "</font>" The only problem is if the user selects a funky color, you'll get a "0". There's probably a solution for that though. :)
×
×
  • Create New...