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?
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....
Private intStart As Integer 'Holds the starting number.
Private intEnd As Integer 'Holds the ending number.
Private intCurrent As Integer 'Holds the current number we are at when counting.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Get the numbers into our class variables
intStart = Integer.Parse(TextBox1.Text.Trim())
intEnd = Integer.Parse(TextBox2.Text.Trim())
intCurrent = intStart
Label1.Text = intCurrent.ToString()
'Check that the start number is smaller than the end number.
If intStart < intEnd Then
'Set an interval to the timer and start it.
Timer1.Interval = 1000
Timer1.Start()
Else
MessageBox.Show("The start number has to be less than the end number.")
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Check to see if the current number is still less than the end number.
If intCurrent < intEnd Then
'Since it is less, add 100 to it.
intCurrent += 100
'Make sure that by adding 100 to it, we didn't pass
'the end number. If we did, then we set the current
'number equal to the end number.
If intCurrent > intEnd Then
intCurrent = intEnd
End If
'Display the current number.
Label1.Text = intCurrent.ToString()
Else
'Our current number is no longer less than the end number.
'We need to stop the timer now.
Timer1.Stop()
End If
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.
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.
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
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.
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?
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:
'NOTE: Make sure the form starts not to be showing the broser
Dim Maxed As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'NOTE: This is the lazy way to do it, but less complex.
Select Case Maxed
Case False
'NOTE: Like hellswraith said, play around with the code
'Add 300 pixels to the form's height to show the browser
Me.Height = Me.Height + 300
Maxed = True 'We have maxed the form
Case True
'NOTE: Again, play with the numbers
'Subtract 300 pixels from the form's height to hide the browser
Me.Height = Me.Height - 300
Maxed = False
End Select
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."