Results 1 to 17 of 17

Thread: Few Questions

  1. #1

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219

    Few Questions

    I have a few questions before i release my program, they are:

    1. I want the user to have the abilty to press a button that will extend the size of a form revealing 2 web browsers because the form just looks to cluttered with them showing all the time. but i want them to be able to press the button again so it will now make the form go back to its oringal size(not showing web browsers).

    2. This problem has been bugging me for a long time, i have tried for hours to find the solution but i cant. This is what i need to do. I have 2 text boxes, and the user enters a number in both boxes. I need to take the first number and add 100 to it until it gets to the number of the second text box. For example if the forst text box was 100 and the second text box is 1000. i need to go 100,200,300,400. SO each time the timer is activated it adds an aditional 100 to the number until it gets to the number of the second textbox.

    3.I need to stop people form hexing my program. I mean just the text part, so they cant change my labels and things like that. Is there a free program that does this?

    Thank you very much
    -Rob

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Re: Few Questions

    Originally posted by VBGangsta
    1. I want the user to have the abilty to press a button that will extend the size of a form revealing 2 web browsers because the form just looks to cluttered with them showing all the time. but i want them to be able to press the button again so it will now make the form go back to its oringal size(not showing web browsers).
    We can't guess as to what your app looks like. Maybe post a screen shot.

    2. This problem has been bugging me for a long time, i have tried for hours to find the solution but i cant. This is what i need to do. I have 2 text boxes, and the user enters a number in both boxes. I need to take the first number and add 100 to it until it gets to the number of the second text box. For example if the forst text box was 100 and the second text box is 1000. i need to go 100,200,300,400. SO each time the timer is activated it adds an aditional 100 to the number until it gets to the number of the second textbox.
    I will get back to you on this sometime this weekend if someone hasn't posted the solution. This is pretty simple. I don't have the time right now to create a proper example for you.

    3.I need to stop people form hexing my program. I mean just the text part, so they cant change my labels and things like that. Is there a free program that does this?
    Maybe check into the obfusicator built into .Net 2003, if you are not using .net 2003, look around on the net for an obfusicator. Might not be free though....

  3. #3

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    For the first question could you just tell me how i whould do it generally, ill figure out the details.


    Ok, that whould be great if you could make me an example for the problem #2.

    And i had no idea that there was a thing in VB.net for what i wanted to do. How do i use it?

    Thanks
    -Rob

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here is your solution to number 2:
    VB Code:
    1. Private intStart As Integer 'Holds the starting number.
    2.     Private intEnd As Integer 'Holds the ending number.
    3.     Private intCurrent As Integer 'Holds the current number we are at when counting.
    4.  
    5.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    6.         'Get the numbers into our class variables
    7.         intStart = Integer.Parse(TextBox1.Text.Trim())
    8.         intEnd = Integer.Parse(TextBox2.Text.Trim())
    9.         intCurrent = intStart
    10.         Label1.Text = intCurrent.ToString()
    11.  
    12.         'Check that the start number is smaller than the end number.
    13.         If intStart < intEnd Then
    14.             'Set an interval to the timer and start it.
    15.             Timer1.Interval = 1000
    16.             Timer1.Start()
    17.         Else
    18.             MessageBox.Show("The start number has to be less than the end number.")
    19.         End If
    20.  
    21.     End Sub
    22.  
    23.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    24.         'Check to see if the current number is still less than the end number.
    25.         If intCurrent < intEnd Then
    26.             'Since it is less, add 100 to it.
    27.             intCurrent += 100
    28.             'Make sure that by adding 100 to it, we didn't pass
    29.             'the end number.  If we did, then we set the current
    30.             'number equal to the end number.
    31.             If intCurrent > intEnd Then
    32.                 intCurrent = intEnd
    33.             End If
    34.             'Display the current number.
    35.             Label1.Text = intCurrent.ToString()
    36.         Else
    37.             'Our current number is no longer less than the end number.
    38.             'We need to stop the timer now.
    39.             Timer1.Stop()
    40.         End If
    41.     End Sub

    For number 1, I need more information on what you are trying to do. Take a screen shot of your application so I can better understand what you are asking.

    As far as the obfusicator, I am not sure how to use it yet. I haven't really cared to use it yet. You should do a search in the MSDN library (http://www.msdn.microsoft.com/library) for how to use it, or on the net somewhere.

  5. #5

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    ok thank you very much, but how do i loop it so it keeps adding 100? or does it already?

    Ill post a screen shot.
    -Rob

  6. #6

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    If u look at it, i want to replace that white box(web broswer) and put it under the form so u cant see it unless u press a button to extens the viewing area downwards so u can then see the broswer.
    Attached Images Attached Images  
    -Rob

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Why don't you put the browser control in a group box like you have done with the other controls on the form. Then you can hide/show it by toggling the group box's visible property.
    Code:
    mygrpBox.Visible = True 'Show the box which includes the browser
    mygrpBox.Visible = False 'Hide the box which includes the browser

  8. #8

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    i really wanted to resize the form because there is going to be something else where the broswer is now
    -Rob

  9. #9
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by VBGangsta
    ok thank you very much, but how do i loop it so it keeps adding 100? or does it already?

    Ill post a screen shot.
    That code does what you want based on what you said. You will have to change the default names to what you have on your form though. Also you will need to add a timer to your form.

    Textbox1 is the start number box.
    Textbox2 is the end number box.
    Label1 is the label that shows the current number as it is counting.
    Timer1 is the timer that ticks which causes another 100 to be added to the current number and it will keep doing it until it reaches the end.

  10. #10
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by VBGangsta
    i really wanted to resize the form because there is going to be something else where the broswer is now
    Try something like this:
    Code:
    'To extend the form:
    Me.Height = Me.Height + 300
    
    'To shrink the form:
    Me.Height = Me.Height - 300
    You will have to play with the number a little to get it right, but I just started with 300.

  11. #11

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    yes thank you that is what i want, is there a way that i can make the form go back to normal by pressing the same button after the size has been extended?
    -Rob

  12. #12
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    Originally posted by VBGangsta
    yes thank you that is what i want, is there a way that i can make the form go back to normal by pressing the same button after the size has been extended?
    VB Code:
    1. 'NOTE: Make sure the form starts not to be showing the broser
    2.     Dim Maxed As Boolean = False
    3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.         'NOTE: This is the lazy way to do it, but less complex.
    5.         Select Case Maxed
    6.             Case False
    7.                 'NOTE: Like hellswraith said, play around with the code
    8.                 'Add 300 pixels to the form's height to show the browser
    9.                 Me.Height = Me.Height + 300
    10.                 Maxed = True 'We have maxed the form
    11.             Case True
    12.                 'NOTE: Again, play with the numbers
    13.                 'Subtract 300 pixels from the form's height to hide the browser
    14.                 Me.Height = Me.Height - 300
    15.                 Maxed = False
    16.         End Select
    17.     End Sub
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  13. #13

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    Is there a way i can just gray out groupbox?
    -Rob

  14. #14
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    Originally posted by VBGangsta
    Is there a way i can just gray out groupbox?
    As in like, make it grey?
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  15. #15

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    Like gray it out so the user can see it but not use it
    -Rob

  16. #16
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    grpBox.Enabled=False

  17. #17

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    Thank You!!
    -Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width