Selecting And Moving Multiple Form Controls At Runtime?
Aug 25, 2010
At design time in the IDE, you can ctrl-click or drag a box around multiple controls on a form and move them all at once. How do you do that at runtime. I need to be able to create image maps based on textual copies of medical claim forms that are generated from different systems and the ability to create dynamic label controls and move a single or multiple controls and resize is required. How does MS do this in the IDE?
View 7 Replies
ADVERTISEMENT
Jun 4, 2010
I am attempting to move all controls on a form down or up by the height of a menubar depending on whether it is visible or not. I have code which I think ought to work well for this, however it seems that Me.Controls is empty at runtime, so my for each loop is never entered. Could someone please offer a suggestion as to how I can move the controls?
Private Sub uxMenuStrip_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles uxMenuStrip.VisibleChanged
For Each control As Control In Me.Controls
If control.Name <> "uxMenuStrip" Then
[code]....
View 2 Replies
May 11, 2011
I am working on a project that I want to allow the user to move and resize controls in a panel container at runtime, much like the developer can do in the IDE.Is there a mode (not sure its the right term) I can implement on a selected control that will show the grab handles and allow moving and such?
View 6 Replies
Jan 7, 2009
just trying to confirm wat i noticed in vs2008,when developing a web app(or wat ever), in my design view, i cant select multiple controls & set same properties i.e. width or CssClass for them all at once (available in vs 2005). i dont know, was it delibrately removed by ms?
View 4 Replies
Mar 15, 2012
I need to change size parameter of OvalShape, I have about 100 of them, named like OvalShape1, OvalShape1...... OvalShape100
This example works for Label, but throws error for OvalShape, following is my modified code that giving error;
For Count As Integer = 1 To 100
[code].....
View 5 Replies
Jan 21, 2012
I know how to create a control at runtime e.g.[code]Can anyone tell me how to create multiple instances using a for-next loop? e.g.[code]The part I can't work out is how to give each new button a new name... like button1, button2 etc
View 4 Replies
Sep 21, 2009
how to add multiple controls at runtime (ex. 10 texboxes)i tried.
Dim txt as New Textbox
Dim i as Integer
For i = 1 to 10
[code].....
View 2 Replies
Apr 4, 2011
I could review that could help me create a designer view (actually similar to how Visual Studio works but more basic), I would like to be able to add controls dynamically (just panels or images), then move those around individually(drag and drop), then count them all and get an array of what I have added..[code]But I would like to get an idea how it looks if things get more complicated..I wonder, are we able to use the classes of Visual Studio's editor in some way? Or are there .NEt classses that can do this?
View 2 Replies
Mar 21, 2009
1. i added a datagrid at runtime on a form. i want to bind a datasource to the datagrid in a button's click event handler, but the datagrid doesn't seem to be visible anywhere else outside the form load event where it is declared. how can i find the datagrid control?
2. and another beginner question.. how to i declare a string that spans multipe lines? i tried with the + operator like in c#, but it doesn't work.
View 3 Replies
Mar 29, 2012
I have created a form Dynamically at run time using this below code but how can i add controls to it.
Dim NewFm as Form
NewFm.ShowDialog()
how can i add treeview to this form and populate with data during runtime?
View 2 Replies
Nov 19, 2010
I'm wondering, when I add dynamically controls in runtime in the form - is there a way to save this controls, and they appear the next time when you run the application?
I'm using VB9.
View 2 Replies
Jan 5, 2011
I want to create a Panel dynamically on the form when a button is clicked. Also labels with given TEXT are also to be created when create label button is clicked. then we should be able to print the form contents as it appears but without any buttons. We should be able to resize the panel to adjust the page size.
View 1 Replies
Jan 27, 2010
Updating a VB6 prog in VS2005 on Windows 7. The prog has an MDI + child forms and there are a number of content types, with varying numbers of controls being set up and positioned from setup files.On forms which are not child forms I can easily add controls at run time like this:
Dim lab As New Label
With lab
.Left = 0 : .Top = 0
.Width = 800 : .Height = 800
[code]....
This doesn't work on a child form, no label is visible. Can't see any obvious problem in quickwatch.
View 2 Replies
Jan 27, 2010
Updating a VB6 prog in VS2005 on Windows 7. The prog has an MDI + child forms and there are a number of content types, with varying numbers of controls being set up and positioned from setup files.On forms which are not child forms I can easily add controls at run time like this:
Dim lab As New Label
With lab
.Left = 0 : .Top = 0
[code]....
This doesn't work on a child form, no label is visible. Can't see any obvious problem in quickwatch. Is there some known reason for this or do I just have a wierd bug?
View 6 Replies
Mar 15, 2009
Supposedly I have a datatable containing 2 columns (controlname as string, containing the name of the control and controltype as string containing the type of the control), for example ("label1", "Label") On runtime i want to loop over the datatable and create the controls from that datatable and add them to the form accordingly. but the problem that i don't know how to convert the control name to a control type, meaning that i want to convert label1 to a type of control Label, inorder for me to set its properties on runtime. so how can i do this and is there a way to convert the string to control according to it controltype.
View 1 Replies
Aug 4, 2010
i want to when in run time i resize the form manually all the controls in the form to resize automatically so how can i do that?
View 1 Replies
Jan 20, 2010
I am new to VB 2008 express (I am a 'C' coder but have played with VB6 before). I am writing a simple program that will use the serial port. What I would like to do is, upon some trigger event, open a form, and depending on the amount of serial ports available, populate this form with an array of checkboxes with each check box corresponding to an available serial port. The user could then choose a port which would then determine the PortName.
View 1 Replies
Jul 29, 2009
I have an MDI application which uses fixed sized forms. I've started to change the forms to sizeable and anchored the controls so they move when the form is resized. If the child form has a menu this jumps onto the parent menu (as it always has done) but all the controls move up the form at runtime and leave a space at the bottom of the child. If I change the form in design mode to cut through the bottom controls i.e. so the form doesn't appear tall enough, it corrects itself at runtime. Is there another workaround as it looks misleading in the designer.
View 3 Replies
Feb 10, 2012
ames tile1 to tile 100Array is loaded from a textfile of 10,10 (not stored as a 10,10 just parsed from line to line, which I feel needs to be changed asap)Each tile is then given a corresponding graphic (e.g. grass, water, lava) and soon hopefully I will add interaction with certain tiles
View 2 Replies
Aug 26, 2010
When I click a cell or a row in a datagridview I want to be able to open a new form with several textboxes and comboboxes in it and to be able to edit the selected row. The only thing I managed to do so far, was to fill a texbox from the form with the info from the sellected cell using the following code.
Dim
cell As
DataGridViewCell
[Code]....
View 2 Replies
Mar 9, 2011
I have eight NumericUpDown controls in my form, I call them NumericUpDown_1 thru NumericUpdown 8. I first noticed when I set a breakpoint in say NumericUpDown_1 routine and have code inside this routine to manipulate say NumericUpdown_6's value, the code would immediate jump to NumericUpdown_6 routine because the value changed. This makes sense since the handler fires due to the default handler - numericUpDown_valuechanges. But I do not want this to happen so I removed the handlers for all NumericUpdownX routines, one thru eight and instead I use "addhandler" and "removehandler" statements inside the individual routines to "mask off" this problem every time I change a numericUpDown.Value that is not in it's own routine.
My problem is this does not work. What I found is if I use removehandler numericUPDown_x.valuechange addressof numericUpdown_valuechange statement the coding would work however when I'm done in that routine I follow up with addhandler numericUpDown... statement and I'm back to the same problem. A different numericUpDown routine will fire because I changed it's value in another routine but I had the handler removed before I changed it's value so I don't understand. It's almost like it remembered that it's value changed as soon as I turned back on the handler using addhandler. I'm working with Visual Basic 2010.
View 13 Replies
May 23, 2012
I'm trying to iterate through a group of ComboBoxes and set a property using a concatenated string & variable to represent the name of the control. However, I can't get the instance of the form to recognize the (String & Integer_Variable) as one of its controls -- and so it doesn't recognize any of the appropriate properties or subroutines as members of the System.Windows.Forms.Control.Is there a cleaner way to do this?
For myTempCount = 1 To 6
If tempValue < Me.("ComboBox" & myTempCount).Items.Count Then
ComboBox.SelectedIndex = tempValue 'appears to work -- how?[code].....
This code was originally VBA / VB6, which I put through ArtinSoft's Visual Basic Upgrade Companion (VBUC). FWIW, I'm using Microsoft Visual Basic 2010 Express.
View 3 Replies
Jul 18, 2009
Im currently working on a project using VS2008. One of the features of this applications is to enable the user to change the theme either buy selecting preset ones or defining there own. The themes used in this application are not the default windows ones. I basically created my own window, titlebar etc... with the use of panels and removed teh windows form borders. So its basically coloring the controls on the form. At the moment the theme information is stored in a "txt" file and when the application loads, it applies the theme to the current form. However, there is more than 1 form within this application. I dont want to write many lines of code to apply certain design/appearance properties to every control in the form. So is there a way to apply settings to a group of controls?
EG: Make all textboxes BackColor Blue
My application also has widgets. All widgets are panels with their names prefixed as "Pnl_WIDGET". Is there also a way to set propeties to all panles with the name beginning with "Pnl_WIDGET"?
View 2 Replies
Oct 1, 2010
How would I go about doing multiple layers on a form?Say the first layer contains a command button that when its click, it changes to the second layer hiding the command button and showing the controls on the second layer?
View 6 Replies
Jun 2, 2011
Still using VS 2005. My concept is to use the same form space to display different "pages", like a "wizard" where you click the [Next] button, and the current UI disappears and a new UI appears. I want to "turn off" multiple controls and "turn on" multiple other controls. Example code: -
Private Sub
Button4_Click(ByVal
sender
[Code].....
View 8 Replies
Nov 10, 2010
I have a form that I will be using to keep track of data for computers I build and will eventually link into a database for configuration management, but for right now I'm just trying to get the basic form layout done and functional. I need this for to be customized for each job I do, that means I can have multiple computers, PC card, peripheral equipment, etc. So with that said basically what I have done is created a user control for each separate item that I want to add (i.e. computer, PC card, etc) that has all the fields and functions I require. When I want to add another computer I just add a tab and place my "computer" user control on it, no big deal...
My issue is when I want to add my "PC card" user control to that "computer" user control. What I am trying to do is to add the first user control(PC Card Info) I created under a button called "Add New PC Card" (which is part of the "computer" user control.)and that part works! What I want to do is keep added as many "pc card"user controls as I need and basically keep appending them under the last control on the bottom of the page (which is the "pc card" user control, that is a groupbox with a few drop down boxes and text boxes in it.)with a little spacing between them. The biggest problem I am having is when I add the first "PC Card" user control, it works.. but when I try to add another one and search the current page for all user controls under a certain point or with a specific name, I don't get any results.
I think I'm on the right track with the following code but I am running into 2 things I can't do that are critical to my needs. 1: I need to define the text of the user control I just added so I can uniquely identify it, so If I need to remove it I can and will also play a role later( I thought if there was some way in code to make my control # a variable that may work) 2: I need to know what to look for since I have a count that represents how many of that particular control exist on my form, that way I can name them properly, this will also allow me a method to delete the user control if desired.
Dim pccard As New PC_Card
Dim x As Integer
Dim name As String
[Code].....
View 3 Replies
Jun 23, 2011
How do capture which button caused the postback on a web form with multiple controls using asp.net
View 3 Replies
Jun 23, 2010
I have a picture box that i want the user to be able to move at runtime of course....he will click on the picture and while clicking the mouse down he can move the picture and when he release the mouse the picture stays at the location ....i searched the net and did not find any usefull articles ..
View 2 Replies
Mar 21, 2010
I'm creating an application in visual basic, basically a part of it is where I hope to achieve the function whereby users can move pictureboxs(images) when visual basic is running.
Basically, i've got several picture boxes that obviously cannot be moved around the form at the minute.
For example, i want to be able the user to be able to move picturebox1 around the form when they click on it and move it where they want to as opposed to what it does now - doesnt move.
View 14 Replies
Jan 9, 2011
How do you move objects in run-time?
View 1 Replies