Jump to content
Xtreme .Net Talk

bpayne111

Avatar/Signature
  • Posts

    335
  • Joined

  • Last visited

Everything posted by bpayne111

  1. MessageBox.Show([Enum].Parse(GetType(Animals), "Dog")) so where does this line become of use?
  2. if you still have that project saved... try using 2 different child forms. And try getting the Activate event to fire anytime AFTER the first activate for that child form. ie. Load both forms as children. Then click back and forth between them and see if it will fire then. The activate event should fire each time the form 'recieves focus' correct? I'll send the code in my next post if needed Thanks
  3. couldn't you just use MessageBox.Show(Animal.Dog) i thought that would return 3 if it does why would you need the others?
  4. could it be that there is just a bug in my version of vs.net? me and my teacher are playing with this and well basically you can't predict when the activate event is gonna fire. Sometimes it works sometimes it doesn't. I have version 1.0.3705 of the framework and i can't upgrade. Could this be my issue? 'frmMain Dim frmTest as form 'modular variable Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick Select Case ToolBar1.Buttons.IndexOf(e.Button) Case 0 'show frmKandles If FormLoaded("frmKandles") Then frmTest.Activate() Else frmTest = New frmKandles() frmTest.MdiParent = Me frmTest.Show() End If Case 1 'show frmSummary If FormLoaded("frmSummary") Then frmTest.Activate() Else frmTest = New frmSummary() frmTest.MdiParent = Me frmTest.Show() End If Case 2 'show frmAbout If FormLoaded("frmAbout") Then frmTest.Activate() Else frmTest = New frmAbout() frmTest.MdiParent = Me frmTest.Show() End If End Select End Sub Public Function FormLoaded(ByVal strName As String) As Boolean 'check to see if form is loaded For Each frmTest In Me.MdiChildren If frmTest.Name = strName Then Return True End If Next End Function Private Sub frmMain_MdiChildActivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.MdiChildActivate 'work to be done If FormLoaded("frmSummary") Then frmTest.Activate() End If End Sub 'code in child form frmSummary Private Sub frmSummary_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated MessageBox.Show("hey 2") End Sub
  5. yes i was playing with that as i wrote the post... why would they do this? i don't get it. It seems impossible to get the 'true' activate event to fire no matter what i do.
  6. To keep it simple... I have a form in an MDI app and i'd like to show a message box when it is activated. The activate event never fires when i load the child form. Is this because it's a child form? I think i've almost got it figured out but i'd like to hear any comments on the subject.
  7. A good option might be to create your own title bar for your program. There is alot of work involved but you could do it. One hard part would be recreating the 'windows gradient' effect on the title bar. good luck
  8. yes indeed that works wonderfully... ok so this brings a new question what is the difference in Type.GetType("Styles") and GetType(Styles)
  9. thanks divil i'll use that this is what i came up with... when run, i get the error "Null Reference Execption" when my code is executed. can anyone figure out what is null??? ComboBox1.Items.AddRange(styles.GetValues(Type.GetType("Styles"))) Public Enum styles br = 7 jpd = 9 End Enum Public Class Form1 Inherits System.Windows.Forms.Form Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.AddRange(styles.GetValues(Type.GetType("Styles"))) End Sub End Class
  10. I'm trying to find the best way to fill a combobox with an enumerator i created I'm sure this is a one-liner but, i can't seem to find the magic method i'm looking for. Any ideas?
  11. please be a little more specific... are you using an excel spreadsheet? If you are making a game are you sure a spreadsheet is what you need... That sounds like a job for a database.
  12. point taken... i personally can't think of an example either but it's the concept that's important i think. LONG LIVE ANDALSO lol
  13. yes you aren't alone, i'm a culprit of that too to an extent... The first step is admitting you have a problem :)
  14. have you considered only showing a certain number of records at a time? granted it's not what you wanna do but it would speed things up
  15. i'll put it in laymans terms... using And or Or will make all operations evaluate reguardless of the value ie (if the first statement is true the second will still evaluate even though it's not needed) using AndAlso or OrElse will stop the evaluation as soon as True is returned and continue to the next line of code. (hence speeding up your code) AndAlso and OrElse have thier downsides... ie. Say the Second part of your evaluation is a Function that changes a variable and you need that value reguardless of the outcome of your statment. So be careful... 99% of the time AndAlso is the way to go but sometimes you need to stick to the old way... this is why MS didn't just get rid of the original And and Or bitwise operators. (or just change them all together. i think i'm gonna mark this day on my calender... i taught divil something yay.
  16. And now i can't even get the site to load :( Did he move it by chance? could just be the server. SCRATCH THAT IT FINALLY DECIDED TO WORK. i guess it wanted me to post this message first lol
  17. probably unanswerable question... Why are't unsigned integers a part of vb? it would seem logical to me ______________________________________ WOW why didn't they add this loop control variable feature long ago??? i wish my version was upgradable :(
  18. has this always been the case or did it happen all of a sudden? if it's always been the case my guess would be because you are using home edition, I'm fairly sure Home Edition doesn't run VS.NET. Although i'm suprised you got that far if that is the case, because my friend couldn't even load vs.net on his xp home edition. my school actually provided us all with xp pro if needed just so we could load the software. Could just be the version we are given. If that's not the case then... well that's super wierd, i'd start to hate computers about now if i were you lol.
  19. Is a compound If Statement faster than a nested If? ie. If x>y AndAlso x>z then 'do someting end if or If x>y then If x>z then 'do something End If End If
  20. see divil's site for great user control info http://www.divil.co.uk/net/
  21. public sub mainForm_Load(byval sender as object, e as eventargs) dim myForm as New PasswordForm myForm.ShowDialog end sub This will load your password form as a Dialog, meaning that the user may not do anything on the main form until you let them basically. (make the controlbox property false to ensure they don't just close it and use the form anyway)
  22. i have the same post somewhree in here SystemInformation.FrameBorderSize SystemInformation.FixedFrameBorderSize SystemInformation.CaptionHeight
  23. Me.Close
  24. even if there is a function.. do the coding yourself for the practice. an if statement would work fine
  25. i was under the impression that you must have XP Pro to run VS.NET... is this only certain editions... my copy won't install on home you sad this happens for every applicatoin? even if you start and new project and run it? try just running an empty project.. and work your way up from there send us some code too that would be nice
×
×
  • Create New...