VS 2008 Debugging The Custom Control?
Jan 5, 2012I have a custom control I've created, and I'd like to be able to step through it (either in a test application or the one it's being used in). Is there a way to do this?
View 1 RepliesI have a custom control I've created, and I'd like to be able to step through it (either in a test application or the one it's being used in). Is there a way to do this?
View 1 RepliesI've not really worked with them before, well at all really. How would I go about creating a control which has multiple picture boxes, so then I can access each picturebox and refer to them via custom properties? I'm not aware you can draw several picture boxes and combine them into one control?
View 2 Repliesthis forum, I made a custom numeric TextBox that was designed to accept monetary input.
vb.net
Public Class moneyTextBox
[code].....
In THIS Thread:NickThissen Said:Quote:It will appear in the toolbox even if you put it in the current project, instead of a control library project.No, it does not have to be in a control library, nor does it have to be a UserControl, to appear in the Toolbox. Any class inheriting (either directly or indirectly) from Control or Component will appear in the Toolbox. Since RadioButton inherits from Control, and your control inherits from RadioButton, your control inherits from Control too, so it will appear in the Toolbox. I have successfully created a pretty cool custom control. I Built the project and have added the a reference to the .dll form a new Windows forms project. It works great, as long as I do something like THIS:
Dim ThisControl As New MyCustomControl
ThisControl.Top = 40
ThisCOntrol.Left = 40
[code]....
I have the above control I am using, whose base class is the ListBox.Unlike the ListBox, it doesn't highlight a new item when it is inserted.I already had to add the ability to InsertAt() a new item since the person who made it originally hadn't implemented that part.But, I am having trouble figuring out how to make that part work.The above link is directly to the original Control.Here is the code for the Insert method I added:
Public Sub Insert(ByVal index As Integer, ByVal value As MCListBoxItem)
Try
List.Insert(index, value)
[code].....
I have several custom controls inside my project, just added a new class and then inherit the original control. For example i have a Custom DataGridView Control (CustDGV), that defines several properties in the constructor of the control.Now i have one problem and one issue, the problem, if i change the CustDGV i don't know why, the forms that are using the control doesn't update the changes... The only way it's removing and adding it again.. not very useful when i have several event's already defined for the dgv.How do i force the form to update the control?The issue it's that some of the properties doesn't get applied, for example i set the column header height and the disable resizing in the constructor, but if i run the code this two properties doesn't get applied, i need to define them in the form where i use the control to get the results that i expect..The order of the properties in the constructor? The properties in the properties window override the constructor ones?
View 17 RepliesI have a panel that has 9 pictures boxes within it. I need the User to be able to create as many instances of this control as they like.
Then each control needs to be able to move freely within the form.
I've created the control and added the appropriate code to move it around the control.
I've made the control canvas the same size of the panel. The problem is that when I move the panel, it only moves within the bounds of the control canvas. I guess I could increase the size of the canvas, but then additional controls would still only be able to move within their bounds and it would come out all wrong.
Is there anything I could do about this? Or is there a better method?
This relates to WPF but is broad enough that a winform answer will do. I have made a few custom controls in the past by inheriting from whatever particular control I wish to inherent from.
I have noticed that I can add a form to a class/user control library from the add new dialog and have it run. When this application is compiled I get a DLL.
So my question is can I use a Form as a custom control. The reason I ask is I am creating a more advanced MsgBox for a new application I require and a form as its container makes the most sense.
I have created a custom control in one VS project. Once tested and built, I then copied the object over to a structured class library type project I hope to use as a code repository for these kind of things. To ensure I can get to the control, I created a test project and added this repository dll as a reference. The problem is that I cannot see the custom control in the toolbox.
Is there an attribute or something I should've used in the repository dll in order for this to happen?
My objective is to create a custom namespace in this repository dll so that any custom objects or controls can be referenced in various other applications without having to copy the objects to each. I know my reference is good as I can create the control in code. I would just like to see it show up in the toolbox!
I created a custom control and I'm trying to insert it into a panel, but also center it.The control itself is larger than the panel, so I've set the AutoScroll property of the panel to True. I think that might be affecting it. Perhaps I should just offset the Y axis a bit.But, either way, this is what I'm trying:
VB .NET
'Create the control
Dim AutomationReport As New AutomationReportControl
[code]....
It works just fine with the X axis, but the control is out of bounds vertically. About 1-2 inches of the top is cut off.
I did try to build a custom control but unfortunately i couldn't make it work due to lack of knowledge.I wanted to build an custom itemlist that allowed me to add 2 or 3 icons beneath it with labels associated.
View 5 RepliesI have a custom control and have created some properties for it.When I click on that control, its properties are then shown in the PropertyGrid.The problem, is that I only want to show some of the predefined properties as well as my custom properties.Does anyone know how I can filter out the properties I want shown?
View 9 RepliesI'd like to know how to make my own custom control. Please guide me from the very beginning, since I'm new to VB.Net2008.
View 4 RepliesI'm trying to add a custom DropDown to the PropertyGrid for a control. I am adding the TrackBar control. It works fine, except, I would like to have the values updated in the PropertyGrid as I move the TrackBar. As it is now, it only updates the PropertyGrid when I finish and click off the TrackBar... I know the problem lies in the Type Editor. How can I get it to allow interim values to be processed. Is there some callback function I can use?
Here is the Type Converter code:
Imports System.Windows.Forms.Design
Public Class Slider
Private editorService As IWindowsFormsEditorService
[code]....
I'm trying to create a custom control that contains a List(Of Panel). I quickly ran into an error about the base class Panel being nonserializable. So I created my own class that inherits from Panel and implemented the ISerializable interface. At the surface, everything appears to work, at least everything at design time. I don't know what would happen if I tried to run the application. Anyway, the errors occur when I try to open a file that contains my custom control. For example, I create a new Windows Form and add my custom control to it. I save the Form and close it.
Then I try to open the form and get the following error: Object of type 'MyTestApplication.SerializablePanel[]' cannot be converted to type 'MyTestApplication.SerializablePanel[]'.
I don't know what I'm doing wrong? I've opened the XML file to see what it's actually writing, and read the header notes about using binary base64 serialization. I think that's what I'm using, but I'm not sure.
Below is the code for the class SerializablePanel:
Imports System.Runtime.Serialization
Imports System.ComponentModel
<Serializable()> _
[CODE]...
I'm coming over from VB6 in which you could use 'user controls' to create reusuable custom controls. They were simple and contained and you can easily create several instances of a user control within the same or other apps. In vb2008 there are user controls but I can not figure out how to add them to forms or or other apps. Can someone please give me the the basic steps to add a custom user control to a form or project.
View 6 RepliesI found a custom ListBox that, strangely doesn't have an InsertAt method and I would like to add one. The custom ListBox uses an object instead of just a list of strings like a normal ListBox. I was curious what the logic behind inserting a new item at a particular index would be.The only thing I could come up with was add the new ListBoxItem at the end, then using the specified index, I could either keep moving ListBoxItem objects to the bottom, with the Add() method, from that index till the ListBoxItem at that index equals the one added, or I could use that index number in a "calculation" till I know I've moved the correct number of objects.
View 14 RepliesI've made my first little custom control. It is a textbox, then next to it a picture. I've written the code already for the picture box. It basically opens up a new form with a listview on it that displays details from the database. But now, I still want the text box to have the basic properties of a normal textbox like text alignment, enabled, backcolor, etc. But not sure how to do this.
[Code]...
So I've made this control that inherits from the treeview control and basically loads objects from active directory into a treeview (url...).All working fine, but as this is the first custom control I have made that I have intended for other people to use, I'm not quite sure how I should approach error handling.I mean, obviously I shouldnt do something like show any exceptions in a messagebox because that might not be what the person that is using the control wants to happen. So do I just write out exception messages to the debug window? Do I swallow exceptions (guessing not)? Do I just totally ignore them so that they are thrown in the user's project?
View 4 RepliesI created a custom control that uses a PictureBox and made that PictureBox movable.
I create the control during runtime and the code works just fine. I can move the picturebox, except it can only move within the bounds of the control, which is the same size as the picturebox.
I have a panel that has a label and a picturebox inside of it and I handle the pictureboxes event like so:
[code].....
I'm using a recursive search to find all of the controls on my form and then do something with those controls once I find them.This is the basic layout:
Form
-----CustomPanel
----------PanelChild
[code].....
how to specify a custom icon for display in the toolbox window when you create your own custom control? Something other than the dreaded "gearbox" icon.
View 2 RepliesI want to create a custom control that has a cursor like a regular text box, I tried using a line and a timer that makes the line 'Blink', but that wasn't too reliable because I had to change the location and background in the timer... I guess I could do it, but I wanted to ask my question here.
Basically what I am doing is creating a custom control to allow inputs as in fractions, sub/superscripts, etc.... The TextBox Control doesn't support text in that many locations.
I have created a custom Combobox and added it to my toolbox, and it works well. Now I have added a custom ListBox to the same file as the combo box, but it does not show on my designer when I place it. I can however add it at runtime.
''ComboBox
<DefaultEvent("SelectedIndexChanged"), _
ToolboxBitmap(GetType(System.Windows.Forms.ComboBox))> _
Public Class ProjectsComboBox
Inherits ComboBox
''My Customization
[Code] .....
I have tried removing the "DefaultEvent..." and still no dice.
So, I'm working on a custom LitBox that accepts custom items. needed the item collection to be more than just strings, I needed to be able to store avalue to display in the listbox and an associated value (Property: Text) that holds an index value (Property: Tag) of DataTable I'm working with.I have created the new item (iListBoxItem) and the collection (iListBoxItemCollection) and have modified everything so that I can do normal Collection type methods (Add, InsertAt, RemoveAt, etc) to this collection.
vb
Imports System.ComponentModel
Public Class iListBox
[code].....
I'm having to write a reporting application that gets information from some Interbase servers and it also has to work on Vista as well as XP, I'm using to connect Borlands Data Provider.[code]My Issue is that debugging on my xp Machine the dataset gets filled, debugging on my vista box it fails ("Interbase provider initialization failed"), my initial thought was that this could be UAC related but I've compiled the application and 'ran as admin' and still same issue. (by the way it failes on the line Dim da as BdpDataAdapter...)
View 1 RepliesI have an ASPX Custom Control which is supposed to load it's properties into an internal collection (defined with PersistenceMode.InnerProperty). Here's the ASPX
<cc:CustomControl runat="server">
<Queries>
<cc:QueryTypeOne ... />
[code]...
I am using custom textboxes and I need to be able to set the Text on txb1 based on the Text of txb2. I have simplied my code to the following:
Public Class customtextbox
Inherits TextBox
Public Event ControlReset()
[Code]....
So, when txb1 looses focus, if its Text is "fried", then it sets off txb2's ProcessAlert function. I had tried to change the value of txb2 Text in ProcessAlert function, but didnt work, so I tried to get it to raise an event instead, which then tries to set the Text property. However I still cant set txb2's Text property. The Text property seems to be set for the duration of the "life" of the Event handler. When I step through the forms controls within the Event handler, the changed Text value is there, but not outside of the Event handler.
I've created my own ascx control with button inside it. Now I'm using this control inside other control. (In my case it is a webpart). What I would like to do is program button.click logic from my custom control inside webpart
View 4 RepliesCan a custom control NEW Sub be the only one that executes when Inheriting from an existing control please?I am Inheriting from TabControl and I do not want the base New Sub called, is this possible?In other words, I do not want TabPage1 and TabPage2 to be added.A Form has an Activated Sub which runs once a Form is activated.It is a pity that Microsoft have not got such a method in the baseControl Class otherwise I could have used it within a custom TabControl.
Public Class Form1
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
End Sub
[code]....