Jump to content
Xtreme .Net Talk

mjb3030

Avatar/Signature
  • Posts

    76
  • Joined

  • Last visited

Everything posted by mjb3030

  1. Ahh. That's it. Thanks.
  2. Thank you for the help. I am assuming that is a C# statement because of the semicolon. I should have clarified that I am working with VB. It still gives me a syntax error in VB. However, I disagree about the readability. I think that statement is pretty straightforward. I think anyone who has been programming with .NET for any length of time is going to be able to see that you are instantiating an object and showing it even though you aren't using a variable. The only time I would use that is in a Sub Main() in order to create a new instance of that class. If that is the only class in my program, I am, basically, running the program. The object will be destroyed when the user closes the program.
  3. Actually, I am using a table style. I'm assuming you mean that you can set the HeaderText property. But, I still don't see the point of having a Caption property with a DataTable if it cannot be seen.
  4. In Java, you can do something like this: new Form().show() I don't remember the exact syntax because it's been a while since I worked with Java, but the point is, you can instantiate an object, including forms, and show them without ever assigning a variable name. If you never have to refer to them again, I don't see the harm in doing that (correct me if I'm wrong). I already tried it in .NET, and it resulted in a syntax error. Is there another way to do this? Or is there a reason that I shouldn't do it?
  5. Gotcha. Thanks.
  6. Thank you. Why is it that you multiply that by 4?
  7. I found some information about this issue at the following address: http://www.dotnet247.com/247reference/msgs/16/84118.aspx There is a post by someone who is, supposedly, a member of Microsoft Developer Support. He is saying that there is an issue with the DataGrid where it does not use the caption property as the header text. I dealt with the problem by hiding the DataGrid header and using Labels instead.
  8. Correction... I meant that should put it in the upper right corner.
  9. Why is it that when I have a parent form and I try to align a child form to its right edge, it overlaps by a few pixels and I get a horizontal scroll bar? I am aligning it in this way: frmChild.location = new point(frmParent.clientsize.width - frmChild.width , 0) That should put it in the upper left corner. It does, but it overlaps the edge and gives me a horizontal scrollbar in the parent form. So, I wind up having to subtract a few pixels from the LEFT coordinate in order to make it fit properly. Am I doing something wrong?
  10. Here is my code: Dim DT As New DataTable("TracLoadData") Dim DC As DataColumn = New DataColumn() With DC .ColumnName = "colRunNumber" .Caption = "Run Number" .DataType = GetType(Int16) End With DT.Columns.Add(DC) DC = New DataColumn() With DC .ColumnName = "colLoad" .DataType = GetType(Double) .Caption = "Load" End With DT.Columns.Add(DC) DC = New DataColumn() With DC .ColumnName = "colTraction" .DataType = GetType(Double) .Caption = "Traction" End With DT.Columns.Add(DC) DT.Rows.Add(New Object() {1, 1204.56, 1320.19}) DT.Rows.Add(New Object() {2, 104.12, 548.23}) dgrTracLoad.DataSource = DT 'dgrTracLoad is my DataGrid
  11. The column headers at the top of the DataGrid... when I fill my DataGrid with data from my DataTable, I would expect to see my DataColumn captions up there. According to the MSDN docs, the DataColumn Caption property 'Gets or sets the caption for the column' whereas the ColumnName property 'Gets or sets the name of the column in the DataColumnCollection'. However, when my form is displayed, the DataGrid column headers contain the ColumnNames not the captions.
  12. Thanks. That's what I was looking for.
  13. I am using a DataTable to populate a DataGrid. I have set the ColumnName property and the Caption property of my DataColumns. The DataGrid is only displaying the ColumnName in the column headers. Shouldn't it display the captions?
  14. I've decided to just go ahead and use 3 datagrids for my 3 columns and bind each one to a separate array. Can anyone tell me if there is a way to center the text in a data grid?
  15. OK, I just saw the previous post with the same question. But, when I checked out the MSDN information about binding it to an array, I saw that the array has to be 1 dimension. I tried it out to be sure (you can't believe everything you read :) ) and saw that, indeed, it does. That won't do me much good as I have 3 columns of data to put into this grid. Any ideas?
  16. If I am not mistaken, the Datagrid control has to be bound to a datasource? I need a simple control with rows and columns that I can plug values into at runtime. It will not be bound to a datasource. Is there such a thing?
  17. The directcast statement gave me an error, but I put the selectionstart first and that fixed the problem. Thanks!
  18. I am using the following delegate for the ENTER event of all my textboxes on a particular form. Private Sub TextBoxSelection(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim tb As TextBox tb = sender tb.SelectionLength = tb.Text.Length tb.SelectionStart = 0 End Sub The problem is that if I type text into a textbox, exit the box, then re-enter it, the text is not selected. The cursor is set at the 0 position as it should be, but no text is selected. HOWEVER, if I then leave the textbox and re-enter it (without making any changes) the text IS all selected. Why doesn't it happen properly the first time?
  19. Thanks :) I must have been replying at the same time.
  20. Never mind.... I just figured out that I can't do it in a form event because I am setting the selectionlength to the length of the text in the textbox. Since no text is in the textbox yet, it won't behave like I want. I guess it has to be done in a textbox event.
  21. Which form event should I use to set my textbox selectionstart and selectionlength properties? I tried the load event and the paint event, but it didn't work there. I am assuming that is because the form hasn't finished loading at those points, and those changes can't be made yet. If I set them in the Designer Generated Code am I going to lose my form in the designer?
  22. Isn't the menu the only class that has the ownerdraw property? How would I go about doing that with a button?
  23. What is the best way to create a fully graphic windows form that functions like a web page (mouseover effects, etc.) but is used in a standard Windows app? See the attached image for an example of what I mean.
  24. I know, but I feel that I have been learning faster since I began using this "basic" approach because it is forcing me to write all the form code myself rather than relying on the IDE. Eventually, I am going to switch back to using VS after I feel very comfortable with the code. However, I also want to learn all about compiling and packaging inside and out without having to rely completely on VS or MSI. I am a rather competent VB6 programmer, but I never learned enough about deployment to be able to fix anything more serious than a basic "missing dll" kind of installation error. I want to avoid making that mistake with .NET. I guess I'll be checking out the Deployment Forum before this thread gets moved because I've strayed too far off topic! Thanks again.
  25. Thank you both. I am now moving in the right direction. I'm still not quite getting it, but I think that is because I still need to gain a better understanding of assemblies and embedded resources. I have no trouble doing this in Visual Studio, but I am trying to also learn to do everything in straight code in Notepad because I want to be able to fully grasp what is going on behind the scenes.
×
×
  • Create New...