VS 2008 Dynamic Pictureboxs?
Mar 20, 2010
im trying to make a program that consists of two forms.One 'toolbox' form, and one 'pallet' form. The toolbox has components that you drag onto the pallet form. Once you drag them onto the pallet form, you should be able to move around the pictureboxes. Unfortunatley, since they are dynamic controls, i have no way of checking what picturebox you click on when there are multiple pictureboxes on the pallet at one time. they are in an arraylist, however i dont know how to check on my mouse_down routine what array index the picturebox is.
View 18 Replies
ADVERTISEMENT
Jun 8, 2009
I am trying to select all the pictureboxs in a flowlayoutpanel control with a for each loop but what should i use as the parent? this is the
For Each Pic as PictureBox in FlowlayoutPannel1 It says that Flowlayout pannel is not a collection but i do not know what to use and the other threads that i read did not make any sense
View 1 Replies
Sep 20, 2008
How do you move multiple Pictureboxs at the same time in one dirction like up down left right with arrow keys in visual basic 2005 express edition
View 1 Replies
Sep 21, 2008
Using visual basic 2008 express enition How do you make multiple pictureboxs center on screen the code i got from a book is this
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
PictureBox1.Left = ((Me.Width / 2) - (PictureBox1.Width))
PictureBox1.Top = ((Me.Height / 2) - (PictureBox1.Height))
PictureBox2.Left = ((Me.Width / 2) + (PictureBox2.Width))
PictureBox2.Top = ((Me.Height / 2) - (PictureBox2.Height))
[Code]...
View 1 Replies
May 24, 2010
I need to represent the following query using LINQ:
DECLARE @PurchasedInventoryItemID Int = 2
DECLARE @PurchasedInventorySectionID Int = 0
DECLARE @PurchasedInventoryItem_PurchasingCategoryID Int = 3
DECLARE @PurchasedInventorySection_PurchasingCategoryID Int = 0
[code]....
Now, I know that a query in .NET doesnt look like this, this is my test in the SQL Design Studio. Naturally VB.NET variables will be used in place of the SQL local variables.My problem is this: All of the conditions after "WHERE" are optional. In that a query might be made that uses one, some, all, or none of the conditions. V.PropertyID and V.Value can also appear any number of times.In VB.NET I can make this query easy enough by simply concatenating strings, and using a loop to append the "V.PropertyID/V.Value" conditions.I can also make a Stored Procedure in MS SQL, which is easy enough.However, I want to accomplish this using LINQ.
View 2 Replies
Feb 19, 2010
Ive managed to dynamically create a form, and dynamically create a timer, but i have not been able to create the timer on the dynamic form. Specifically, i need to be able to have the timer itself create another form with a timer. (I realize that this would create a new form every interval on the timer, that is what i want to do)
1. A way to add the timer to the dynamic form, and maintain the timer sub on my main form.
2. A way to create the whole thing over (dynamic form and timer) through the previous dynamic form and timer.
I was thinking i could use a collection/array to store the forms and timers, but i'm still having trouble figuring out how to add entire forms or timers into a list. (A timer is not considered a control, so i cant use a controlcollection...)
Heres my code;
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New Form
[Code]....
*EDIT* Btw, my idea was to use i as a variable that increases every time a form is created, then insert the form into the array, with i as the integer. i just need to know how to create a new form with a different name each time. (as with timers)
View 1 Replies
Oct 20, 2010
I have the following html code for some pictures:
<table cellpadding='0' bgcolor='#ffffff' cellspacing='0' style='border: solid 3px #470506;padding-right:1px;'><tr><td><img src='./images/counter/b.gif'></td>
<td><img src="./images/counter/3.gif" border="0"/></td>
[code].....
View 4 Replies
May 8, 2011
i have created a dynamic tabpage and a dynamic tablelayoutpanel inside it then added dynamic textboxes and labels inside the tablelayoutpanel...the thing is , i am having a problem on how to access the value of those textboxes and labels and add them as new columns in the new table(tagpage) in mysql database, i can already create the table in the database but i cant add the new columns in it. heres the code for accessing the values of the labels and textboxes
error: NullReferenceException was unhandled....Object variable or With block variable not set.
sql = "alter table " & tbl_selected(counter) & " add " & frmMain.Controls("TLP_" & SecArrList_sp(counter2)).controls.item(SecArrList_sp(counter2) & "label" & counter).Text & " varchar(100) NULL;"
View 2 Replies
Feb 5, 2010
I would like to bind a DataGridView to a different LINQ query every time (in order to reuse the same form/DGV for different queries), like this:
[Code]....
but the "Qry", and the number of comboboxes, and their field names would change every time.
View 5 Replies
Feb 29, 2012
Basically i have one TabControl with a form and 2 browsers within one form I have ProBlem To call the dynamic browser to navigate with dynamic Textbox.text
[Code]...
View 6 Replies
Oct 17, 2011
This is an extension of my last question which was answered, so I am starting a new thread. I have a query in LINQ that I was given to trim down the columns of a datatable. This works well, however, I need to make the LINQ query dynamic. So the query below:
Dim qColumnsIWant = From row As DataRow In inDT.AsEnumerable() _
Select _
EPN = row.Field(Of Integer)("EPNID"), _
EPNID = row.Field(Of String)("EPNNumber"), _
Ingot = row.Field(Of String)("Ingot"), _
ShopOrder = row.Field(Of String)("ShopOrder")
View 5 Replies
May 18, 2009
I basically just want to be able to make the image use the SelectedIndex as the end of the resource, like this
PictureBox.Image = My.Resources.Vehicle_Ary9(Helicopters.SelectedIndex)
This of course won't work though.
So the vehicles are all in the format Vehicle_number, so how can I make this work :S
View 2 Replies
Mar 30, 2012
I have an application which is using a set of three combo boxes. I have managed to populate each drop down depending on the selected value of the previous one The only problem is that, since the data is coming the database two selected values from the first combo box may have two different number of items in the database. so the second combobox should be populated with such data each time the selectedIndex_changed nethod of the first combobox is invoked
if for example, the first combo box's first item has 10 corresponding items in the second combo box and a first combo box's second item has three corresponding items in the second combo box, selecting the second item after selecting the first item will lead to second combobox showing the three items and seven empty entries trailing after the three.
What I want is to have the second combobox loaded with three items exactly when the second item in the first combo box has three items in the database
here is an example
Private Sub cboAccountGroup_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAccountGroup.SelectedIndexChanged
If mblnAccountGroupFirstLoad = True Then
Exit Sub
[Code]......
View 1 Replies
Oct 4, 2010
I am creating a data logger that pulls data from an existing OPC server. When the data logger is launched, I look into the OPC server and get the names of the sensors that need logging (ColumnNames() as string) . From that, I am creating a data table with columns based on the items in ColumnNames(). That part is working. What I am having problems with is adding rows to the table. When I read the values from the OPC server, I get an array of strings (values() as string) which is guaranteed to be in the same order as the ColumnNames.I have been trying to use an SqlDataAdapter with a dynamically built insert command, but it is getting extremely convoluted and ugly.Is there an way to add a data row to my table using an array of string values directly?
View 5 Replies
Jul 9, 2009
I am trying to get the hang of Dynamic loading of objects from assemblies on the same machine (But NOT part of the same project).In the sample below, Form1 implements an interface built as part of the .dll I placed in C:Release. I am trying to create a local instance of Form1, and Cast it as Iform, so that the local code can access the properties and methods exposed by the interface.The assumption here is that at runtime, local code will have access to the String name of a form, and an interface which is implemented by the form (and is compiled into the .dll as well as the client application), and that is it.
When I run this code, I get a exception: "Unable to cast object of type 'WindowsApplication1.Form1' to type 'WindowsApplication1.Iform'.
Public Function fApplicationObject() As Iform
Dim sLocation As String = "C:ReleaseWindowsApplication1.dll"
Dim sType As String = "WindowsApplication1.Form1"
[code]....
I seem unable to dynamically load an object from a dll and then utilize an interface to access it's properties and such.
View 9 Replies
Jun 3, 2009
I have some code to create dynamic serial port objects, now Im trying to add an event handler to the object so I can capture the dataReceived event. But the vb designer is saying ".datareceived" is not en event of 'object' in this case serialports(dComPortNum)
Public serialports(5) As Object
dComPortNum=1
serialports(dComPortNum) = New SerialPort
[code]....
View 4 Replies
Mar 19, 2009
I have a container with different controls in it. This container can be shown 1 or more timeson a form. The number of times is not known when the application is build.So form with the number of containers must be generated by code. When the number of containers is high a scroll bar must be shown.My idea was to use the control TableLayoutPanel. The first row consists of the container with it's controls. When loading the form a number is calculated. This number is used to show the number of containers.
View 6 Replies
Mar 9, 2010
[code]That code will add a new DropDownItem everytime I click on it, then everytime I click on those new created items it calls my "aa" function. How to I set this up so I can send a parameter? It just needs to be a single int parameter.
View 15 Replies
Jun 28, 2010
I'm working on creating a new version for my MultiCode editor. I wanted to add in something like visual studio, and other programs use like color changing according to the certain piece of code like:
<html>
<body>
<p>Hello</p>
[code].....
View 2 Replies
Oct 15, 2009
I'm trying to create a Dynamic Controls that are created within the Form code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
dim blah as new timer
[code].....
View 6 Replies
May 26, 2010
We are using the .NET PropertGrid to edit the Usersettings of our application. If we use Strings or integers than it works perfectly. Now we need a propery, we call them "Vendor", that store a GUID of the Vendor from a database. But the user didn?t see the GUID in the PG. he can choose beetwen the venders Names in a combobox. This combobox must be loaded from the database I have start to try to solve that with following
[Code]....
View 2 Replies
Apr 15, 2011
i have managed to add menu strip items and add a Click Handler to it fine But now i am going to remove the click handler, and want to add sub items in the menu instead the current code i have so far..
[Code]...
View 2 Replies
Jul 1, 2010
I am currently attempting to devise an algorithm that will take a list of part numbers with their corresponding levels and create a Tree View. Here is a sample of the data I am using.
[Code]...
I just can't seem to get the "Do Something" code right.
View 4 Replies
Feb 15, 2012
I have this code which saves the dump file in a static path or destination Process.Start("C:xamppmysql inmysqldump.exe", "-u root ipoint -r C:Backupipoint.sql") MsgBox("Backup Database Created")
I want to choose the path by using the folder browser dialog which will put the path on a textbox but this code below doesn't work Dim path2 As String = tb_path.Text Process.Start("C:xamppmysqlinmysqldump.exe", "-u root ipoint -r '" & path2 & "'ipoint.sql") MsgBox("Backup Database Created")
View 2 Replies
Oct 19, 2010
Can i create a table with the input taken from user at runtime from vb.net.?
From vb.net in sqlserver 2008
View 1 Replies
Jan 1, 2010
I am working with a simple game idea. I wanted to have two players running around shooting each other (very low graphics, like circles and squares). I've got this far; I have the ability to move around both characters, and change directions etc. ive also been able to set up my shooting. Only problem I run into is getting the bullet to move! I cant use a preset timer, because if I used that, I could only shoot one bullet at a time, so I would need to create new ones dynamically.
So my question is; how does one add dynamic timers to a form on runtime, and alter the tick sub so that it moves the picturebox (bullet) and once it can be moved, (I was thinking about using player locations in relation to the bullet, and if they were equal than the health would go down or whatever, but unfortunately, this means it would have to be directly in the middle of the player, which would be odd..
View 8 Replies
Dec 6, 2009
I am making a hangman clone for boredom and I can't seem to make the labels show up properly. Maybe I'm doing this wrong entirely and should just limit what's visible instead.
vb.net
Imports System.IO
Imports System.Text
Public Class Form1
[code]....
View 1 Replies
May 31, 2009
I need to create some serial port controlls manually. My program reads through a config file, and it if comes across an entry called COMPORT then I need to create a contol to talk to this port. The entries in the ini file might be
COMPORT=COM1
COMPORT=COM3
COMPORT=COM7
So here is my problem! I'd like to create the variable control name with part of the com port number, so I can always refer back to it.
EG.
Dim strVar as sring = "COM1"
Dim CName+strVar As New System.IO.Ports.SerialPort
View 1 Replies
May 30, 2011
I am working on an application which involves serial port communication with stepper motors. Now I am sending queries to the PLC via modbus protocol. There is one query in which I ask the PLC for the current position of the moving motor and display it in a current position textbox using a DO Loop. Here the problem is the textbox only displays the position at the end of the motor movement and not while the motor in movies though I have included the code to do so inside the DO loop. So pls anyone who has the solution for this or any other alternative to perform this type of dynamic data display updation then pls reply.
View 1 Replies
May 17, 2011
Im working on a project that includes a TableAdapter for filling data. I usually use parameters for queries I create, but what would be the best way to create a query that may have a wildcard without creating a bunch of queries?
[Code]...
View 4 Replies