Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. A CollectionBase based class simply implements ICollection, IList, and IEnumerable so that you can add objects to them and enumerate them. The idea of typed collections is that you can make the 'Add' function, etc. accept a type of object other than 'Object'. In the case of Panel (which is a sub-class of Control), a typed-collection already exists (System.Windows.Forms.ControlCollection). The Control collection of the UserControl uses this type of collection and so will indeed work in your case.
  2. ComboBox1.Items.AddRange(styles.GetValues(Type.GetType("Styles")))It looks like that line should read: ComboBox1.Items.AddRange([Enum].GetNames(GetType(styles)))
  3. OK, in your PageCollection class, add a member variable: Private _parentUserControl As UserControland change the constructor of the PageCollection as well: Public Sub New(parent As UserControl) _parentUserControl = parent End SubThis will store the control that the class is going to be used with, thus exposing its Control collection. Now, change the Add method: Public Function Add(ByVal Item As Panel) As Integer _parentUserControl.Controls.Add(Item) Return List.Add(Item) End FunctionThat will add the panel to the UserControl. Finally, you need to change the constructor of the PageList class: Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() SetStyle(ControlStyles.AllPaintingInWmPaint, True) SetStyle(ControlStyles.DoubleBuffer, True) _pagecollection = New PageCollection(Me) '<-- I added the [b]Me[/b] parameter here, 'so the current UserControl will be passed to the PageCollection. End Sub
  4. Heh, cool. I didn't know that. Perhaps I am thinking of VB6. Learn something new every day. :)
  5. Well, the way I would do it is to store a "ParentUserControl" property within the PanelCollection. Then, when you create the PanelCollection, set the ParentUserControl = the UserControl you're using (Me). Then, in the Add method of the PanelCollection, use _parentUserControl.Controls.Add(myPanelObject) _parentUserControl being the member variable containing the reference to the parent UserControl.
  6. You will need to synchronize the panel collection with the Control collection on the UserControl (that is, when you add to the panel collection, add to the control collection, when you remove on the panel collection, remove from the control collection, etc). You can do this by doing Me.Controls.Add(thePanelObject). Then you will need to manually make each panel visible/invisible when you want to see them.
  7. If it's a simple authentication using GET or POST (clear text, that is), you might be able to use the UploadData method of the WebClient class. You might need to make it handle cookies that it sends you though, I don't know.
  8. PHP is indeed a very messy language internally, but that doesn't mean your code can't be well organized; you can create classes and whatnot and organize your code that way. Also, I think PHP is going to be able to use .NET components in the future. And divil, PHP does have COM support in it somewhere. [edit]COM functions in PHP[/edit]
  9. As far as I know, you can't get the names of the Enum values, as they don't exist (AFAIK) anywhere but inside the IDE. Once the program is compiled, I think the Enum values are simply replaced with their integer values.
  10. Convert.ToString(<value>, 2)That'll return the binary.
  11. Like I said, you most likely can't. I doubt tooltips are actual objects, and therefore cannot be ownerdrawn.
  12. I highly doubt that Tooltips are any real physical object that have handles and DCs and whatnot. They are more than likely just drawn on the screen. Unless you draw your own tooltips on the screen's DC like that, I don't think you can change the existing ones.
  13. A TelNet like this in ASP.NET is, as far as I know, impossible. All ASP.NET is processed server-side, and so is already processed by the time the user gets it. The only good way to do something like this online would be to write a Java applett or something similar.
  14. Is this an ASP.NET page? If it is, you need to make sure that you have write access to the database on the server through the IIS control panel.
  15. Yes, but the width of the previous checkbox might not necessarily be equal to the width of the text within. In fact, now that I think about it more, your way is indeed what is needed no matter what method you use, but you need to set the Width of each Checkbox beforehand using the MeasureString, so the width of the Checkbox is the same as the width of the text (plus the size of the check-box itself).
  16. Yes, but if you want all the checkboxes' text to be on one line (without word-wrapping), then you need to use the MeasureString way to actually set the widths of the checkboxes. With Robby's way, the controls might be laid out like: [size=1][ ] Check1 [ ] Another Check [ ] Yet another [ ] More[/size]rather than: [size=1][ ] Check 1 [ ] Another Check [ ] Yet another [ ] More[/size]
  17. You should probably check to see if your DataReader's HasRows property is set to True before you try and get the data out of it. If your query didn't return anything, then you can't get data out of the reader, obviously. Not sure if that's your problem, though.
  18. Volte

    me.Hide

    1) Nothing 2) You might try using a Sub Main with Application.Run() to start a message loop without a form. Then you can possibly show/hide your form whenever you want. 3) You can use the 'Closing' event of a form to capture its closing. If you wish to stop it from closing, set e.Cancel = True, and then hide the form, and do whatever you like. Just make sure you provide some way to close the program.
  19. That's true, but if you wanted to place the function in a class, rather than a form (I prefer to stay away from putting functions inside forms, unless they are form-specific), then you would need to create a new Control and get the font. Afterwards you can destory the Control and all is well again. Still, your way would work better within a form.
  20. DataRow[] would be an array of DataRow objects; you need to specify an element in the array. So, if you want to edit the first row that was found, you would call foundRows[0].BeginEdit(); If there were multiple rows returned by your query, and you want to edit each one, then a foreach loop would do the trick. foreach (DataRow dr in foundRows) { dr.BeginEdit(); // code dr.EndEdit(); }
  21. You should find all the links on one page first and add them to a list. Once they are all found, destory all objects created by that page and then go through the list one by one doing the same thing for each page in the list.
  22. Use Server.MapPath("nameOfDatabase.mdb") to get the real path to the database.
  23. Are you sure you're not opening the database twice in your program (i.e. calling OpenConnectionToMDB and forgetting to close it after you're done)? Also, did Access crash while the database was open, or did you close it unusually? If it did, there's a chance that the database is locked. Look to see if there's a .ldb file in the directory with the database.
  24. I think using Server.MapPath("myMDB.mdb") will get the proper path to the file in ASP, assuming it's in the same directory as the ASP file. If it's not, then Server.MapPath("myDir\myMDB.mdb") then.
  25. What does 'CloseConnectionToMDB' look like? It looks like that's where the error is happening.
×
×
  • Create New...