Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You should have a look at the DataList control - you can specify a property of RepeatColumns to say how many columns across. Also easy to data bind.
  2. If instead of using an array for the phonelist you used either a ArrayList or inherit your own collection from ArrayList then you would have an Add method.
  3. What kind of layout are you looking for? You might want to take a look at the DataGrid or the DataList controls - much easier then writing the HTML yourself in a loop.
  4. s = d.ToString("dd/MM/yyyy") although the bit s = d.ToString(ci.DateTimeFormat) formatted okay for me - did include the time portion though.
  5. If you add a reference you can select System.Management, no need to go to the COM tab at all.
  6. Whoops - only read half your question Dim ci As System.Globalization.CultureInfo = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB") Dim d As DateTime = DateTime.Parse("01/04/2003", ci) Dim s As String s = d.ToLongDateString() 'May work s = d.ToString(ci.DateTimeFormat) 'Should work
  7. try Dim ci As System.Globalization.CultureInfo = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB") Dim d As DateTime = DateTime.Parse("01/04/2003", ci)
  8. Can you give an example of the code from the calling form?
  9. Also forgot the classic http://www.weebls-stuff.com/
  10. You could add a context menu to the form and associate it with the tree view.
  11. The code given is C# - % is the modulus operator (it returns the remainder after dividing two numbers) if you are using vb then there is a mod function If txtField.Length Mod 2 = 0 then 'even else 'odd end if
  12. ListBox1.SelectedValue =
  13. Could you show us some code and give some details about class names / dll names and locations?
  14. How are you terminating your application? If your app shuts down cleanly then the icon should be removed. Also when you say 1 - 3 icons appear on startup are some of these left over from previous runs of the app?
  15. Application_end only fires when the web application shuts down. You probably want to use Session_End.
  16. At the moment though the choice of languages can be a good thing - without the C# crowd looking down on VB as a 'toy' language. Also in the current state the differences between the languages are quite minor. If the languages start to diverge (Edit and Contine, Default Instances on Forms etc) then supporting and using both languages will become more of a chore (especially if you are not in a position to choose a language).
  17. http://www.sysinternals.com/ntw2k/source/tcpview.shtml, includes some c source as well.
  18. You can't include a C/C++ header in a VB application. You could call a DLL written in C/C++ that contains a wrapper for that function - but not call it direct.
  19. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=81759&highlight=ctype+directcast
  20. If you are writing out just text then you may want to look at the StreamWriter class.
  21. Ahhhh, it returns a DataRowView not a DataRow so the following will compile (haven't checked to see what it does at runtime though....) dv = Me.dsCategory.Tables("Category").DefaultView Dim row As DataRowView row = DirectCast(Me.BindingContext(dv).Current, DataRowView)
  22. Which line is giving the error then? That seems to be the only part casting between object and DataRow.
  23. Dim DRow As DataRow DRow = directcast(me.BindingContext(DataView).Current,DataRow) 'Then just change the values DRow("ColumnName") = "BlaBla"
  24. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim regClasses As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot Dim regWord As Microsoft.Win32.RegistryKey = regClasses.OpenSubKey("AcroExch.Document").OpenSubKey("shell").OpenSubKey("open").OpenSubKey("command") Dim adobeReaderPrintCommand As String = regWord.GetValue("").ToString() Dim pi As New ProcessStartInfo pi.Arguments = "c:\test.pdf" pi.FileName = adobeReaderPrintCommand.Replace("""%1""", "").Trim Dim p As New Process p.StartInfo = pi p.Start() End Sub worked on mine, although if ADOBE is the default handler then the following may be asier Dim pi As New ProcessStartInfo pi.FileName = "c:\test.pdf" Dim p As New Process p.StartInfo = pi p.Start()
  25. You are not testing the result of the message box you need to use something like If MessageBox.Show("Do you want to continue?", "Info", MessageBoxButtons.YesNoCancel) = DialogResult.Yes Then ' // Do the Yes part Else ' // Do the "other" part End If
×
×
  • Create New...