VS 2010 - Events Being Unlinked When Cutting / Pasting Controls
Mar 27, 2012
Let's say I cut a tab control with buttons on it and paste it into a Panel control. After doing this, all my control events are being unlinked from the event code. I have to manually relink all the events in the Properties window. Is there any way round this?
View 15 Replies
ADVERTISEMENT
May 22, 2011
Basically i work as a desktop support officer. our team does everything from fixing software errors on PCs in the office to moving them from one desk to another. When we do have to move anything though, it needs to be tracked so that our records can be accurate. To track where things have moved to, we have to:
1. fill out a form in an excel format and then fill out the same information into a text file format, and then attach both formats to the job record in our job listing system and send it to our hardware tracking team.
2. If an asset is being taken away to storage, but is considered to be too old, it needs to have an excel table filled out to create a 'disposal' label, or it can create a 'redeploy' label if it still has some years left in it.
3. If we are putting out a brand new asset, it needs to be updated on our tracking sheet to show that the asset is no longer in our storage as brand new.
This obviously creates a lot of administration work for our staff, so i have built my program to take all the information required once, and then split it off to the forms and labels as required.The part I'm stuck at is number 3. I have been working with the excel files in the following format:[code]What i need to do is as the title suggests, search an excel work book (the user will point to it) for the Asset Number in a particular sheet. Once it finds the asset number, cut the entire line out of the sheet and paste it into a different worksheet at the next empty line with a few edited values.
View 1 Replies
Mar 29, 2011
I'm working with the graphic designer in Visual Basic 2008 Express Edition. I tried to cut and paste a groupbox and the variables reverted to standard ones (CheckBox123 etc.), and when I tried to change them back to their proper names, I got an error message stating that this name is "already in use by another component". But this is nowhere to be seen anywhere in the "Form1.vb[Design]". How do I either get rid of these "hidden" variable names or reunite them with the groupbox they used to belong to?
View 8 Replies
Feb 27, 2012
I made a custom control for my form. It's basically a custom button I made using a label.The only problem is, when I apply a myButton_Click event to the control in my main form, it will only be triggered if the control itself is clicked. The label takes up the entire form (it's docked inside it). The click event isn't triggered when the control (virtually the label) is clicked. You must click behind the label (the form's background) for the event to be triggered. How can I pass the myButton_Click event to the label so it is triggered when the label is clicked? I hope I'm making sense.
View 9 Replies
Dec 22, 2010
I'm trying to raise an event in class A and catch it in class B which does not contain class A. Is this possible? [code]
View 10 Replies
Jan 14, 2012
I have a text box that I will paste into a byte array, for example:
02 01 05 BF DD 03
All I need to do is when I click on a button, for the program to take the length of the array and store it in RCVDMSG_Length() and then take the contents of the text box and put it into a byte array RCVDMSG(). From there I think I can figure out how to manipulate the array... but it's this first step that I'm stuck on....
So far I have this in my Form:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim RCVDMSG() As Byte
Dim RCVDMSG_Length() As Integer
RCVDMSG_Length = Len(TextBox1.Text)
View 5 Replies
Jun 4, 2012
I am creating a VB application in Visual Studio 2010 that installs some SQL stored procedures. These stored procedures are encrypted otherwise I would just supply my clients with .sql files to create the stored procedures.
The install script that creates the stored procedure is 1500 lines in length and has been formatted in the way VS 2010 requires multi-line literals to be in:
"First Line" & _
"Second Line" & _
"etc..."
[Code]....
View 1 Replies
Apr 13, 2012
I'm converting a VB project to C#, and I notice that in vb it will call a function like:[code]on the asp.net source page or it will never hit the function. Is this a necessity in c#, or is there something that I'm overlooking or missing? Basically, is there a way in c# for it to hit that function like in VB without adding the line above in the source page?
View 2 Replies
Aug 9, 2010
I have combobox and I was wondering how do I call one of its events, for example,MyComboBox5_SelectedIndexChanged. I have no idea what to put in for its sender and e arguments.In other words; how do I complete the following statement
View 4 Replies
Jan 7, 2010
I have created a form in a project with some controls on it and put code behind those controls so they all work as I want them to. I now decide I want to group those controls within, say, a Groupbox to visually isolate them from the rest of the form.
So I select all the controls, delete them, create the new Groupbox, paste the deleted controls back and all looks OK. However, all the controls have now become "detached" from their associated events. The events still exist in code and the controls still retain all their properties but the controls no longer function.
Is there a way to "refresh" the project so that the controls are re-attached to their events or do I have to go through each control and do it manually?
View 3 Replies
Apr 18, 2011
I want to use the following snippit.
For Each x As Control In Me.Controls
If TypeOf x Is CustomControl Then
SomeAction( x.CustomEventofCustomControl)
End If
Next
The problem here is that not all controls have event CustomEventofCustomControl, so the complier shrieks. How do I get around this.
View 2 Replies
Oct 1, 2011
I'm developing a website in visual studio 2008 using (asp.net/vb)I have to allow registered users to build pages and add controls that are already defined by the same userMy problem is how to build this page dynamically?In other words, I'd like to make like any CMS (e.g. Joomla). CMSs allow us to make new pages and add our controls then save them..
View 1 Replies
Feb 10, 2011
How to define handler events for dynamic controls.
View 3 Replies
Jun 16, 2009
I have a form with 2 contols that I with to connect by drawing a "wire" on the screen. It goes like this: you mouse down on the first control then move the mouse while holding the mouse button down. When the mouse is over the 2nd control the mouse button is released and the controls are wired.
So I am playing with mouseup, down, move, etc. When the mouse is over the first control I get mouse moves from that control, but when it moves off the events stop, and I get no events from the form even though the mouse is there.
Is there a way to do this? I have seen it done in a Java app. I could brute force it and just draw a box on the form instead of a control, but that sounds like a step back.
View 7 Replies
Feb 12, 2012
Handling Events For An Array Of Controls
View 3 Replies
Mar 5, 2010
Im curently writing an app for windows mobile (so its using the compact .net framework)It has a loop which finds out how many images are in a folder, makes a picturebox for each one, then sets the .image property to the appropriate image. It also adds the name, size, location etc.What I dont know how to do is add a mouseclick event to it?I probably would have a subroutine already written in the code which could be used, or would it have to be a new one made for each picturebox?
View 1 Replies
Jul 28, 2011
I have this issue where I'm trying to generate HTML to display on the page that is coming from the database in form of a template that has different curly brackets that get replaced with dynamic content at run time. For example curly bracket {Content} gets replaced with a few checkboxlists, radiobuttonlists, textboxes and a submit button. The way I'm doing this is by creating controls dynamically and rendering them as string and then outputting that string to the browser. But what this does is, it doesn't recognise the events assigned to the controls when they are generated. I may be taking a wrong approach to the issue, but I don't really see how else this can be achieved. I have put up some sample code below to show what I'm trying to achieve.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
[Code]....
View 3 Replies
Jun 22, 2009
I have a number of user control dynamically added to a page, and user interaction with these dynamically added user controls need to be handled by the control's parent. Is this what is referred to as "event bubbling"?How do I do that in VB?
View 3 Replies
Jan 5, 2011
I've a control that throws an exception in one of its events and I need to catch this exception. How can I do this?
Example:
Private Sub AxNtlxImage_Reason(ByVal sender As Object, ByVal e As AxNTLXIMAGELib._DNtlxImageEvents_ReasonEvent) Handles AxNtlxImage.Reason
' TODO: Deal with this reason message
Throw New ArgumentException(e.sText)
End Sub
I want to catch this exception from another procedure when it happens.
View 8 Replies
Apr 22, 2009
I like to build objects that contain properties and also functions / subs to do work. I dont have a lot of other programmers around me to answer this question so I thought id ask. If my goal is to make a function or even sub part of a class blue print is it better to do it by making a seperate class for the function, and then construct a new copy of the classFunction as a property of the parent class or is it better to simply put the function in the parent class.
[code]...
View 1 Replies
Apr 5, 2009
I had been searching as to how I could create an array of controls dynamically, and after some searching found some helpful code as shown below [code]This way in the above code "structureComboBoxes" will have an array of comboBoxes (VB6.0 was way easy to get this crap done!! I guess its cleaner here)Now my next problem is How do i code for events of each of these combo boxes?
View 6 Replies
Oct 16, 2011
I found this mystifying in VB6 and it's still here...
For example - I have a combobox on a form and I have put some code in its SelectedIndexChanged event. The problem is that I want this code to be executed *only* when the user clicks on an item in the combobox dropdown. Why is it then that it gets executed when the form first loads? And how do I stop this happening?
I used to use a "FormLoading" boolean to decide whether or not the code was executed but this surely shouldn't be necessary. Is there a better way?
View 2 Replies
Mar 11, 2010
I have VB 2008 Express and I am also new to VB. My problem is I cannot find any assistance with creating an Event that is attached to a Control that I inserted on a dynamically creeated TabPage. I call the "create_tab" sub (below) that creates a New TabPage and add some Controls (Button, two textboxes). Now, that I have the TabPage (and there could be multiple), I want to bind an Event to these items. So when a user Clicks on the Button in TabPage1, for example, a Sub executes where I can manipulate the data contents of the textboxes. Here's My code that creates the tabpages dynamically.
[Code]...
View 11 Replies
Aug 30, 2011
I have created a simple custom control - we will call it a "panel with buttons". Here is how I instantiate it:
[Code]....
So what I wind up with are multiple instances of my panel. Each of these panels has a button on it called Button1.
My question is - how do I capture this button event in a way that I will know which panel index it came from?
In the custom control there is only the Button1_click event - and when I click on it in any of the multiple panels I manually instantiated the event does occur, but how I can tell which one of my instantiated buttons were clicked...
View 1 Replies
Dec 7, 2009
I am trying to make a small control that has a picturebox and a few labels that can be dragged on the form it is placed on. The control was easy, and I can drag it fine when the mouse is down on the control, where there are no other controls, like not over the picturebox or labels.
When i try to click and drag the user-control and the mouse is on the picture box or labels of the control the mouse down event is not detected. I am hoping someone can tell me how to pass the mouse-down event from the controls on the user-control so the form I place it on detects the mouse down even no matter where on the control i click.
View 6 Replies
Oct 31, 2011
Public Class aaMyForm
Inherits Windows.Forms.Form
Added some controls. Build it, add the .DLL as reference to my other project.
In my other project:
Imports MyLib
Public Class XForm
Inherits aaMyForm
The events from aaMyForm execute correctly but the controls added to it are not shown on XForm. I have found some info about set Modifiers Protected in order to be able to change the functionality of the controls but havent found anything about why the controls aren display on the XForm.
View 5 Replies
Jan 27, 2010
Builting a calculator. I have a string of two numbers separated by an math sign. Knowing the length of the first number then adding one for the sign will produce the start length of the second number. Trim the original string to get what I need.
dim num(25) as double
dim length,length1 as integer
dim string, string1 as string
length = Len(num(n - 1))
length1 = length + 1
[Code]...
View 3 Replies
Feb 6, 2012
Basically, I have an Access database with Primary keys that are structured with this format ("02"000).When I try to paste the number, it ignores the "02" and goes straight to 000.For example, here is the code;
PeriodRoomID.Name = ("R" & ds.Tables("sqlSpecRoomRequest").Rows(i).Item(1))
What PeriodRoomID.Name should be is R02001.What PeriodRoomID.Name comes up as is R1.It ignores the "02" and ignores the 0s. This makes sense mathematically but it is not what I want. I need a way to get the exact output and not some simplified version.
The query;
SELECT SpecialSoftware.SpecSoftID, SpecialSoftware.RoomID, SpecialSoftwareNames.Description, Rooms.Capacity
FROM SpecialSoftware, SpecialSoftwareNames, Rooms
View 3 Replies
Jun 25, 2012
I must input a letter and a number in a text box.. say "A14", and them I want to cut the string into "A" and "14" and then use these, but I do not know how to code this as the next string could be "A1" or "C110" and these change... could I make an if for each one? like an if for when its 2 characters and just cut it in half and then an if when its 3 characters and cut between the 1st and second and so on?
View 4 Replies
Sep 7, 2011
What is wrong with this code?When the code runs cmd.ExecuteReader I get an error saying "Incorrect syntax near the keyword 'AS'".I'm assuming I didn't breakup the sentence correctly.
Using cnn As New SqlClient.SqlConnection(clsDBConn.clsDBConnections.prpConnString)
cnn.Open()
Using cmd As New SqlClient.SqlCommand[code].....
View 4 Replies