Put RTF Text In A Control's Tag Property?
Oct 27, 2009Is it possible to put RTF text in a control's tag property?
View 5 RepliesIs it possible to put RTF text in a control's tag property?
View 5 RepliesIs there a way to bind the text property of a control to an expression? I have a user control that I add to a FlowLayoutPanel. You can see I have 4 controls in the FlowLayoutPanel below. The first control is a LinkLabel and the other three are my user controls which are numbered 1, 2, & 3. I'd like to bind the label that shows the 1, 2, or 3 to the user controls index within the FlowLayoutPanel.
If I happen to remove the 2nd user control I want the 3rd user control to now display 2. I could use the FlowLayoutPanel ControlAdded or ControlRemoved events, but wanted to see if I could do some binding first.
I have a list view with Two Columns. I want to set text in the Column Header as "Bold" & Text Align as "Center". But the text in the rows of the list view not required bold & center.
So, How to control them independently...?
Question II:
How to modify the Height of the rows...?
I am making a custom button control and am having some difficulty with my Text property. Anything I type in only stays while the form designer window is open. When I close the form designer and reopen it, my Text property resets to "". Also if I run the program, it loses the value entered at design time.
I also have an Image property for my control which is working just fine.
Here's some of my code:
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Windows.Forms
[Code]....
I have a form which allows the user to create a question to find items.One of the questions is in the format of Something > a numeric value..So I used the NumericUpDown control. I set the NumericUpdown control to a valid range of values like 1 to 100.The user can clear the numericupdown control in which case the "Value" property returns the previous value prior to the user setting it to a Null String.
View 3 RepliesI did some googling and found this forum post, and here is what I needed to do:
Imports System.ComponentModel
<EditorBrowsable(EditorBrowsableState.Always), Browsable(True), Bindable(True), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _
[code].....
When I put a label on a form, the Text property in the designer can be expanded to a multi-line edit box. (This is in VS2005.)
Is there a way to get that type of edit box on a custom String property of a usercontrol?
I created a simple user control with a label, and one property that allows me to set its text.I can call the property Text2 and everything works well, but if I call it Text it doesn't work.
I tried both this:
<Browsable(True)>
Public Overrides Property Text As String
[code].....
I have a form with about 48 checkboxes.I have a public sub that reads a webpage, parse the text of that site to get the values that correspond to these checkboxes.For example: one of the lines would be: "Exterior = 255", or "Street = 0".I do have check boxes that called "Exterior" and "Street". the question is how I can get my sub to address the appropriate control so I can set its "checked" property based on the text read.
View 3 RepliesIs there a property of a grid view control that can set the text size of a column header?
View 2 RepliesI have a usercontrol which overrides the property Text. But this property is not shown at design time.If I rename it to caption or value it is shown in properties at design time but Text is not shown.
public Class SomeControl
Inherits System.Windows.Forms.UserControl
Public Overrides Property Text() As String
[code].....
I have a dataview an i would like to show the count property in a text box.
i tryied the following
me.textbox1.DataBindings.add(new DataBindind("Text",DataView,"Count"))
But i have a exception.
I want to type the characters from right to left (to behave as a right alignment). But I am not supposed to use the Right Alignment property or the RighttoLeft property of a text box.For example, I want to enter the characters of a string from right and each character should shift one space left so that the user can enter another character after that.
View 13 RepliesI would like to be able to set Control visual properties such as color, boarder, flat style, etc. on the base class of the control so that as I add new instances of the control, each instance inherits the visual properties of the base. I have tried using Application Settings but it appears as though I need to reference an application setting manually each time I add the control to a form. This is a Windows Form question.
View 4 RepliesI'm trying to make a program with transparent labels over pictureboxes and when I set the label Parent to the PictureBox the position of the label changes.
View 2 Repliesi frequently have troubles with the dock property. it seems that either the order of creation or adding to the parent control determines whether or not a control's dock property supersedes another's. e.g. a control with the dockstyle fill will overlap with another docked control on the same parent. does anyone know what the rules are to determine how docking will behave; particularly in dynamically created GUIs?
View 2 RepliesIf I need access to the value of a user control's property BEFORE PreRender, would I need to base the custom control off of one of the preexisting data controls (repeater, listview,etc.)?One of my user controls features a gridview control that is configured based on the user control's properties on which it resides. Several of the key properties alter the SQL Statement for the underlying recordsource. I'm now in a situation where the property that sets the WHERE statement for the SQL Statement needs to tied to a value in the user control's parent FormView. Think of the formview as displaying a customer detail record. The user control takes the customer's account number and then displays data from a related table such as Customer Contact Names. Since the gridview is created before the control's prerender event, working within the prerender event doesn't seem efficient.
View 1 RepliesI inherits textbox Control and I added some new properties to it .one of these properties value i want it to change it's value in desgin time when i change Name property of the new textbox
Public Class NewTextBox
Inherits TextBox
Private _txtSubName As String = String.Empty
That is the property for set or get SubstringName of Textbox
Public Property SubName() As String
Get
Return _txtSubName[code].....
that's the property i want to change it's value when i change Name property of the control.i tried to overrides Name property but it's not overridable also i trieds to overloads it but it doesn't work in desgin time.Here is something i tried but it's wronge.
Private _txtName As String = ""
Public Overloads Property Name() As String
Get[code]......
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TextBoxContents As String
TextBoxContents = Button1.Text
TextBoxContents = Button1.Text
End Sub
End Class
[URL]when I debug it I press Button1 the text property I assigned to it doesn't appear in the text box.
I have created a custom class, which contains a panel and a label on it. I added to this class a pcaption property, which holds the label text. This property is browsable and I can change its value.But when I drag the custom control to the form and change the pcaption property, it has no effect. Even the <Defaultvalue> has no effect. Why?
Here is the class code:
Imports System.ComponentModel
Public Class mypanel
Inherits Windows.Forms.Panel
Private panelcaption As String
[code]....
Color values are unimportant, you can change it.
I have a number of pages which implement the same interface:[code]The function doSomethingToTextBox takes a textBox item as a parameter and performs some action on it.I know the textBox is contained on every page which implements my interface, and that it has the same name on each page.My question is: how can I declare the textBox as an interface property? This will remove the need to pass the textBox as a parameter to doSomethingToTextBox()I must also add that I'm currently accessing the TextBox using get/set methods defined as part of the interface - I don't want to have to implement these methods for each page as they are exactly the same on each page.
View 1 RepliesI am using ASP.NET XML control and on Page Load event I am updating its DocumentContent property but the problem is data isn't being shown. The control is empty on page load.
xmlDIMenuSource.DocumentContent = "<Menu><Parent ID="1" Name="Order" SortOrder="1"><Child ID="21" Name="Create an Order" URL="../Order/OrderCapturingv4.aspx?Action=new" SortOrder="1" /><Child ID="32" Name="Import a Style" URL="../Order/OrderCapturingv4.aspx?Action=import" SortOrder="2" /></Menu>";
I am working with dev ex controls and on a menu bar item there isnt a property for setting the button to Visible or not Not Visible. Can you add properties like this to pre made controls? If so how would you do it?
View 2 RepliesI want to get a control's property from a BackgroundWorker in my form:
foreach (ListViewItem i in ListView.CheckedItems) { //error: Cross-thread operation not valid: Control 'ListView' accessed from a thread other than the thread it was created on.
//do something with i
}
In this example the IsEnabled property of my button is bound to the selected rows "Local" property of the grid and it works just fine:
<Button DockPanel.Dock="Bottom" Width="100" Height="100" IsEnabled="{Binding ElementName=dataGridRestore , Path=SelectedItem.Local}"></Button>
<my:DataGrid x:Name="dataGridRestore"
ItemsSource="{Binding}"
[Code]...
How to detect if a particular control has a particular property?
I am considering writing a generic routine and I would like to know how you can detect whether a particular object has a particular property?
Something like this code:
If HasImageProperty(myObject) = True Then
EndIf
I guess reflection would be used here, but I am not very familiar with reflection.
[Code]....
I have inherited a vb6 app that I am trying to upgrade to VB2008.
If I can find out that a control has a ToolTipText property as below, how can I get the value?
For
Each ctl In frm.Controls
If Not (ctl.GetType().GetProperty("ToolTipText") Is Nothing) Then
[Code].....
I have created a form dynamically. On this from I have added two user controls. The first user control(Mylabel) is inherated from label and the second one(Mybotton) from button. On my Label control I have added a method as follows:
Public ReadOnly Property ctlStatus()
Get
Return (m_Selected)
End Get
[code]....
When i set visible property of a control.
What happen with that control ? It merely hide or disposed from memory away ?
I am developing a custom control with VB9, and I want to add a Property Name TextFileName this property need to use OpenFileDialog, which type I can use when I define this property?
for example another property I use is EnterFocusColor and its type is System.Drawing.Color so when the user select the property it opens the ColorSelectionDialog Hany M. El Tarhony