Answer Questions
Henry_Yang Find the ID of the dynamically created controls
Hi, This is the requirement. I am trying to create the controls dynamically based on the values in the Database. I am able to create the controls successfully. I have a repeater control in the ASPX page. On the Header Template, Item Template and Footer Template, call a class Template. On Databinding of this Repeater control, calls a method inside the class Template. This method creates the controls dynamically, & adds them to the place holder. In creating the dynamic controls, there are dropdown list controls. Based on the value in the Dropdown, I wanted to hide certain controls. F ...Show All
ceilidhboy Form style/control
How can i do something like this: http://img7.imagevenue.com/img.php image=29013_control_122_442lo.jpg Group information with option do retract and expand items. Thanks Thanks Bhanu! Mark I never use before GDI. I try with this solutions. Thanks!! Joao your going to need to create a control that inherits from System.Windows.Forms.ContainerControl and then override the OnPaint method and use GDI to do all the drawing. In the OnPaint method you can then add code for when the control is expanded and also for when it is collapsed (use a property value) and paint accordingly. You'll need to give the control properties that can set this at both desi ...Show All
Enkht How can I resize controls at run time by mouse?
I have some controls on my Form such as Treeview and ListView. Now I want to resize them at run time like Outlook Express but I do not know how to do that. Please tell me the way to do that. Thanks in advance! Phuc Pham. Hi, if you are using .Net 2.0 you can use the SplitContainer control, you can then change its Orientation property to either horizontal or vertical to achieve the effect you want. By docking/anchoring the child controls in either panel they will resize and you move the splitter. Mark. Hi, what do you mean exactly by resize, as in some kind of splitter window where you can move the separator bar to show more or less of the tree If so then user the Splitter control. It will allow y ...Show All
Joeschoe How to set the forecolor/backcolor in the row/col headers in a Data Grid View?
This code in a form's constructor: Controls.Add( new DataGridView ()); DataGridView newDataGrid = ( DataGridView )Controls[0]; newDataGrid.Dock = DockStyle .Fill; DataTable Moose = new DataTable (); Moose.Columns.Add( "Col1" , typeof ( String )); Moose.Columns.Add( "Col2" , typeof ( Int32 )); Moose.Rows.Add( new object [] { "Value1" , 1}); Moose.Rows.Add( new object [] { "Value2" , 2}); Moose.Rows.Add( new object [] { "Value3" , 3}); newDataGrid.DataSource = Moose; newDataGrid.DefaultCellStyle.ForeColor = Color .Green; newDataGrid.DefaultCellStyle.SelectionForeColor = Color .Green; newDataGrid.DefaultCellStyle.BackColor = Color ...Show All
Philip Quirke how to create a scrollable picturebox
If it is a small picture(whose size is equal to the picture box size) scrollbar should not appear..if it is not so..it should have scroll bar..once we scroll we can see the remaining part of the image. Anyone can provide a code for this. and also usefull link . thanks and regards, Uvaraj T Rather than using picture box make your own control deriving from a usercontrol.Set the autoscroll prperty to true; please see the follwoing code. public partial class UserControl1 : UserControl { private Image image = null ; public UserControl1() { InitializeComponent(); this .AutoScroll = true ; image = Bitmap .FromFile( "C:\\Picture.jpg" );//name o ...Show All
thomaskremmel Control Question!!! Help!!!
Ok guys i need your help. I have a panel control with a textbox inside, next to the panel there is a button. Now what i want, and i don't know how to do it, is when i click at the button i want that another panel show under the first panel, but exactly like the first panel with a textbox inside and a button next to it. Thanks Merovingio. Ok i did it!!!! A friend gave me the code i was looking for Here is the example code: Public Class Form1 'Location of the next Panel Dim NextRecLoc As New Point(10, 10) 'The "active" textbox (TextBox left of the button) Dim CurrentTextBox As TextBox = Nothing Dim WithEvents btnPanelButton As New Button 'Adds a panel with textbox below the last one ...Show All
SunilN "PropertyGrid" problem
Hi there, I've created an expandable "PropertyGrid" control that initially looks like this when fully expanded -Name -Dimensions 10,20 Width 10 Length 20 As soon as I type in something for the "Name" property however and press <Enter>, the grid then looks like this: -Name Whatever +Dimensions 10,20 Width 10 Length 20 Notice the "+" that now appears beside the "Dimensions" property. The grid automatically collapses the "Dimensions" property IOW (why ) but doesn't clear out the "Width" and "Length" beneath it. It appears to be a cosmetic problem only since if I call " ...Show All
BIGuy can any one tell me how to develop smarter user interface for windows application
how to develop smarter user interface for a windows application I am not really sure what you are asking. Maybe on of these link will help MSDN Center for User Interface MSDN Smart Client Developer Center ...Show All
jhapps Control.InvokeOnClick and Validation of a Form
I have a Form with a WebBrowser control on it. Since the WebBrowser control seems to muck with certain hotkeys that I want to use on a navigation panel (full of buttons with ALT+<KEY> accelerators), I've overridden the ProcessCmdKey method of the Form and am intercepting such hotkey codes and mapping them via a hashtable to the appropriate button that I need to programmatically click.However using Control.InvokeOnClick seems to directly call the attached click event listeners rather than attempt a mouse_down followed by a mouse_up event which can be cancelled via a Control.Validating event handler's argument being set to "e.Cancel = true;" . So the problem is the Control.InvokeOnClick never causes the Form or any ...Show All
Ryan S. Grouping radio buttons
I'm stuck on radio buttons in C# alas. I can group them by putting then in a Group box, that falls into place. But I want to treat them in code as a group too. I want to be able in one line of code to get the button which is selected, not have to scan through them all one by one. Can this be done Is the group of radio buttons itself available as an object that can be queried with regards to the status of the current seelction in that group Unfortunately there's nothing built-in to do what you want. I would suggest that you handle the Click event for the radio buttons. You could wire up the same event handler for all the radio buttons in a group dynamically so you always have the currently check button without having to query them a ...Show All
Sanjukta ListBoxes transfering from 1 box to another
Hi! What I'm Trying to do: Basically, I select an item in ListBox1, click a button, and it'll transfer to the 2nd ListBox and remove itself from ListBox1. I've accomplished this, the problem is if I hit the button, without selecting anything in ListBox1, the program will crash. I know where the fault lies, but I currently can't think of any alternative method (New to C# and programming), to accomplish this task other then my current code. My current button click Code: listBox2.Items.Add(listBox1.SelectedItem); listBox1.Items.Remove(listBox1.SelectedItem); Much thanks to anyone who can help me out! :D excellent, glad I could help! Yes it does, thank you very much!!!!!!!!! ...Show All
Lakshmi N datetimepicker databinding issue
i unchecked a checkbox-enabled dadabound datetimepicker at runtime, but it's value stays checked all time, is there a way to force the control to unchecked The datetimepicker value can only be changed when the checkbox is checked. ...Show All
samymelbourne Can we make Winform Datagrid control default sort arrow more prominent in .Net 2003
Hi- Is there any possiblity to make Winform Datagrid control sort arrow more prominent in .net 2003. Like in Windows forms Datagrid control when user click on the column header, default sort arrow will appear. Is there any possiblity or any methods to override, so that we can place different arrow or image on the datagrid contol sort arrow look more prominent Thanks ...Show All
Ken_Bussell BindingSource problem when AddNew() get Called and when a control lose the focus
Hi everybody, I somehow developed a generic form, that allows to speed the development of forms, because the form have the insert, update, delete, retrieve, etc, all ready implemented. I inherited the winforms controls to work whit this form, so I can extract the info and create the statements to be executed in the DataBase. I Have a control inherited form the TextBox, I added a new property that works like a keyValue for the text showed in the Text property, it's like I have a Table in the dataBase, and one column in the table, is a key to other table, so, I bring the table to memory, in a DataTable, but I can't show the key to the user, the user must see the text related to the key, so I added the property to my inherited control ...Show All
roxtar Force to show scroll bars on a ScrollableControl
Hello. If I draw a shape (say rectangle) outside the client area of the ScrollableControl, how can I force the latter to show scroll bars so the user could view the drawn shape Thank you beforehand, Mikhail. Oh, I get it. The AutoScrollMinSize property must be set to the whole area onto which the drawing being done, not the client area. Thanks Try this. I moved the rectangle to (100, 100) or it is nearly impossible to find... using System; using System.Drawing; using System.Windows.Forms; class MyClass : ScrollableControl { public MyClass() { this.AutoScroll = true; this.AutoScrollMinSize = new Size(2000, 2000); } protected override void OnPaint(PaintEventArgs e) { Rectangle rc = ne ...Show All
