Jump to content
Xtreme .Net Talk

fenris

Members
  • Posts

    22
  • Joined

  • Last visited

About fenris

  • Birthday July 31

Personal Information

  • Occupation
    Programmer (VB,Java)

fenris's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Here is what I have done and it seems to work well: Private Sub AddRow() Dim row As ListViewItem Dim column As ColumnHeader If ListView1.Columns Is Nothing OrElse ListView1.Columns.Count = 0 Then Return Dim subText_Col(ListView1.Columns.Count - 1) As ListViewItem.ListViewSubItem For Each column In ListView1.Columns If column.DisplayIndex = 0 Then row = New ListViewItem(column.Name) ElseIf column.DisplayIndex > 0 Then subText_Col(column.Index) = New ListViewItem.ListViewSubItem(row, column.Name) End If Next row.SubItems.AddRange(subText_Col) ListView1.Items.Add(row) End Sub It is a little different, but your idea helped point me in the right direction. Thanks!
  2. I'll have to test it out, but that looks like what I have been trying to acomplish! Thank you very much :D
  3. I am working with VB 2005 express edition and I have a listview control on a form with 2 buttons. I want to allow the user to be able to reorder columns to suit their needs. I have no problems with this. I also want them to be able to remove columns or re-add columns based on their wishes. My problem is if a column is added, after the user changes the position, the data gets added to the wrong column. Any ideas on how to do this properly? The code below illustrates what I am taking about. Public Class Form1 Private myColumns(6) As ColumnHeader ' Used for creating column headers. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Make sure that the view is set to show details. ListView1.View = View.Details ListView1.AllowColumnReorder = True ListView1.GridLines = True ' Create some column headers for the data. myColumns(0) = New ColumnHeader() myColumns(0).Text = "Column 1" myColumns(1) = New ColumnHeader() myColumns(1).Text = "Column 2" myColumns(2) = New ColumnHeader() myColumns(2).Text = "Column 3" myColumns(3) = New ColumnHeader() myColumns(3).Text = "Column 4" myColumns(4) = New ColumnHeader() myColumns(4).Text = "Column 5" myColumns(5) = New ColumnHeader() myColumns(5).Text = "Column 6" myColumns(6) = New ColumnHeader() myColumns(6).Text = "Column 7" Me.ListView1.Columns.AddRange(myColumns) ' Loop through and size each column header to fit the column header text. ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent) ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AddRow() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListView1.Columns.Remove(myColumns(3)) ListView1.Columns.Remove(myColumns(0)) ListView1.Columns.Insert(3, myColumns(3)) End Sub Private Sub AddRow() Dim row As ListViewItem Dim subText_Col(5) As ListViewItem.ListViewSubItem row = New ListViewItem("Col 1") subText_Col(0) = New ListViewItem.ListViewSubItem(row, "Col 2") subText_Col(1) = New ListViewItem.ListViewSubItem(row, "Col 3") subText_Col(2) = New ListViewItem.ListViewSubItem(row, "Col 4") subText_Col(3) = New ListViewItem.ListViewSubItem(row, "Col 5") subText_Col(4) = New ListViewItem.ListViewSubItem(row, "Col 6") subText_Col(5) = New ListViewItem.ListViewSubItem(row, "Col 7") row.SubItems.AddRange(subText_Col) ListView1.Items.Add(row) End Sub End Class
  4. I know this is a little late, but have you considered a bsd variant? I am currently using NetBSD (http://www.netbsd.org) as my subversion server. I have apache, openssl, subversion,ssh and php. All of the apache services are over ssl. I absolutely love NetBSD, it is relatively simple to install and get up and running. I have mine running on an old amd k6-2 400Mhz with 64MB of ram. I had experimented with linux 5 years ago using redhat. I had used it as a NAT router and firewall. I found it came with too much stuff. NetBSD has a system called pkgsrc which is basically all of the source code to all of the software you could need to run a server. If you want to install a package, say apache, flip to the apache directory in pkgsrc and run make install && make clean && make clean-depends. The thing about NetBSD is nothing is installed unless you want it. I have been running the server for a couple of months now and I love it. I don't use any GUI becuase I like to be able to administer it remotely through an ssh shell. You learn pretty quickly how to do things. Cheers....
  5. I think what you are looking for are permutations, here is a link that you might find interesting.
  6. What is the best font to use in a typical business type application? I am leaning towards tahoma or verdana. Also what would be the implications of using this Font? I have a project that has a large number of places that use fonts (labels, text boxes, etc.). Is there any way to change the default font of the project so that it is reflected in all of the items that use that font either on the fly or in design mode? Thanks.
  7. What do you have so far?
  8. :D Regex is great for parsing text, I use it (well at least I try to use it) for parsing html tables from downloaded html source.
  9. I hear that! Regular expressions are entirely different langauge that were designed to parse text expression very well. I don't think that you need to use them for you particular circumstances. I would use a couple of classes like this: Public Class Team Private _Name As String Private _CoachName As String Private _ID As String Private _Picture As String 'could be an IMAGE object as well Private _NameAbbreviation As String Private _Email As String Private _Players As Collection Public Property Players() As Collection Get End Get Set(ByVal Value As Collection) End Set End Property Public Property Email() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property NameAbbreviation() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property Picture() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property ID() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property CoachName() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property Name() As String Get End Get Set(ByVal Value As String) End Set End Property End Class Public Class Player Private _Name As String Private _Position As String Public Property Position() As String Get End Get Set(ByVal Value As String) End Set End Property Public Property Name() As String Get End Get Set(ByVal Value As String) End Set End Property End Class Then I would load the xml into vb and create the collections from there. Once the classes are created, you can then create the new xml files any way you please. You can also output the data to text. Here is an example to get you started.
  10. Why not create a class that loads that particular xml structure, then write it out as a differenct xml file with only the nodes and attributes that are required?
  11. Does any one have any information on creating these files - particularly the file format? I am in the process of creating an image management program and I would like to create thumbnails of the photos to speed up photo browsing. My first thought was to create thumbnails and place them in a subfolder of the photo folder. This idea is reasonable but I was thinking there has to be a better way. Then it hit me, why not use the mechanism that windows 2000 and XP use to create thumbnails. Ultimately I am looking for information on creating these files without the aid of windows so that older O/S' can create these files. Any ideas?
  12. Does anyone know how to create an iso image from a directory structure that is recognized by typical cd burning software?
  13. I wouldn't have bought a new car if I didn't have the commute I have now. I would have spent my money on a new computer! :D
  14. My first car - 1974 Ford Montego. That was a beast of a car. It was like driving a boat at 100mph down the highway. My second car - 1984 Chevy Sprint. My third car - 1987 ford ranger. This little truck served me well for many years. It also served my uncle up until it died at around 300,000 km. My first new car - 2003 Toyota Matrix. A nice little car that hasn't let me down yet!
  15. I try to use them when ever I need to parse big strings (anything over 1000 chars). I am not very good at using them, but every attempt helps...
×
×
  • Create New...