ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Visual Basic .NET - Can I make a dynamic GUI?

<< < (2/3) > >>

wreckedcarzz:
I can make a control invisible by simply changing a setting in .NET on the options bar off to the right - that isn't an issue. I just don't see what you mean by copying the original button to the new location?

CWuestefeld:
If it's simply a matter of moving a control, all you need to do is to modify its location via the Top and Left properties, like so:

--- ---        Button1.Left = x
        Button1.Top = y

Attached is a simple project with 1 window. Click the button to see a message box. But if you're holding down ALT while you do it, it moves the button to the next corner of the window, clockwise. It's a VS2008 project, so you may not be able to read it, but even if you can't, just open Form1.vb to see the form's code.

BTW, when I said "look at the code that the designers generate", I meant look in the FormXYZ.Designer.vb file. The designer generates code here that actually creates and places each of the controls you put on the form. This will show you how to actually create new controls dynamically.

wreckedcarzz:
Alright, now I think I understand. :) Downloading now (I have VB '08). Will take a look and see if I can make sense of how to do this myself. Thanks!

wreckedcarzz:
On a related note, I was wondering if there is a way to change to a different tab when a button is clicked. Something like


--- ---Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
On Error Resume Next
GoToTab("TabName")
End Sub

I have been searching for about 2 weeks on this and come up dry on whatever search results I try. I am thinking about just typing in commands and using the autocomplete function in VB Express Edition to scan and see what commands I can look into that could help me with this (it works sometimes).

Anyone got any ideas for this? There has to be a way to do it, but I just can't find out how! :tellme:

wreckedcarzz:
Never mind, I was able to find a solution via guess and check. I am starting to love the autocomplete option. :-*

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version