Jump to content

Making tools..

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
22 replies to this topic

#1
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
Is it possible when somebody presses on a button: "More textboxes" That it will create an extra textbox, can I do this with visual basic 2005?

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Yes, it is - just create a new TextBox object, set it's Parent property to the current form, and then voila. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
And with a code?

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Hmm... well, I'm not too sure, we might need to do some testing again...
Try this:
[highlight=vb]
Dim txt As New Textbox()
txt.Parent = Me
[/highlight]
What does it do?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
Thank you!

#6
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
It works? Great - I've impressed myself. Superxav to the reeessccuueee... :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#7
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
So if I press the button 2 times 2 boxes will appear? I would I change de second's coördinates?

#8
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
I've got no idea how you got the umlaut 'o' on coordinates, but:

[highlight=vb]
Dim x,y As Integer

'Set values here
x = 200
y = 200

txt.Location = new System.Drawing.Point(x,y)
[/highlight]
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#9
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
I know that, but what I'm meaning is: If I press the button 2 times, will be there also 2 textboxes created? Every time you press the button an extra textbox will be created?
And how would I prevent it with a code from having the same coördinates?

#10
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Oh, I see - you could have two boxes on the form that allow the user to select the coordinates, then display it. Or do you want the boxes a set amount apart every time?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#11
wazofski

wazofski

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
Yeah, The coördinates are autmaticly set by that button, But 2 textboxes mustn't have the same coördinates

#12
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
OK. Two questions:

1. How do you want the multiple boxes to be arranged?
2. How big is the height of the text box?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums