Search Results

Search found 2806 results on 113 pages for 'winforms'.

Page 49/113 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • Of Datagridviews, databinding, and non validating cell values.

    - by Yanko Hernández Alvarez
    Lets simplify. Lets say I have this class: class T { public string Name { get; set; } public int Age { get; set; } public int height{ get; set; } ... } and I have a DataGridView's DataSource bound to a BindingList <T>, with N columns, each one bound to each property. I need to: Allow the user to enter non validating ages, heights, etc (for instance "aaa") Color the cells with non validating values (red background) Retain the non validating values displayed until the form is closed (I don't want to lose the values entered until the form is closed, so the user has the option to correct the bad cells anytime he wants BEFORE closing the form) Keep the last correct values entered for each cell with non validating values entered. When the form is closed, ditch the non validating values and keep the last correct values entered. Is there any easy way to do this?

    Read the article

  • Iterating through tooltips

    - by icemanind
    Guys, I have a windows form with a panel control and inside the panel control are several other controls with a System.Windows.Forms.Tooltip attached to them. How can I iterate through each tooltip and set the Active property of the tooltip to false? Tooltips, unlike other controls, are not actually controls. So I had this: foreach (System.Windows.Forms.Control ctrl in this.pnlControl.Controls) { if (ctrl.Name.StartsWith("tt")) // since all my tooltip names start with 'tt' { System.Windows.Forms.ToolTip TipControl=(System.Windows.Forms.ToolTip)ctrl; TipControl.Active=false; } } This does not work though. It gets an error because the ToolTip control is not inherited from System.Windows.Forms.Control. Any ideas?

    Read the article

  • Fill Combo-box via DataSource Using Values from Various Columns

    - by peace
    Employee emp = new Employee(); comHandledBySQt.DataSource = emp.GetDataFromTable("1"); comHandledBySQt.DisplayMember = "FirstName"; The above code displays drop list of employees first names in a combo box. I want first name and last name to be displayed. How can i do it? I tried to include two columns FirstName and LastName as below but didn't work. comHandledBySQt.DisplayMember = "FirstName" + " " + "LastName"; Any help will be appreciated.

    Read the article

  • Using Application Settings and reading defaults from app.config

    - by Peter Goras
    Hi, I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5) And I need to provide a configuration file for this app that any user can modify. For this reason, I am using Application Settings instead of standard appSetttings in app.config so I can separate the the user config from app config. see http://msdn.microsoft.com/en-us/library/ms228995(VS.80).aspx Creating a Settings.settings file using VS generated a class with hard-coded default values like this: [global::System.Configuration.DefaultSettingValueAttribute("blahblah")] public string MyProperty ... WTF? I want to read the default values from the app.config! So I created my own class deriving from ApplicationSettingsBase but I cannot get this to read values from the app.config. Any ideas?

    Read the article

  • How do I detect if a System.Windows.Forms.Label with AutoEllipsis is actually displaying ellipsis?

    - by SchlaWiener
    I have a Windows Forms Application where I display some client data in a Label. I have set label.AutoEllipsis = true. If the text is longer than the label, it looks like this: Some Text Some longe... // label.Text is actually "Some longer Text" // Full text is displayed in a tooltip which is what I want. But now I want to know if the label makes use of the AutoEllipsis feature at runtime. How do I achive that?

    Read the article

  • anyone research DevExpress' source code ?

    - by MemoryLeak
    I want to study the source code of DevExpress, does anyone have any information about that ? Since I really don't know how to start to read it. if you are also researching the source code of devexpress and you would share it on your blog, then could you please give me your blog link ? EDIT: once you purchase the universal version it will offer you the source for debugging, please refer to https://www.devexpress.com/ClientCenter/Order/default.aspx?group=.NET

    Read the article

  • C# WinForm Drawing - how to clear and redraw

    - by StoneHeart
    Here is screen shot of my game. On the left is my problem, seem "old draw" still existing. On the right is what it should be. http://img682.imageshack.us/img682/1058/38995989.jpg drawing code Graphics g = e.Graphics; for (int i = 1; i < 27; i += 1) { for (int j = 0; j < 18; j += 1) { ZPoint zp = zpoints[i, j]; if (zp != null) { g.DrawImage(zp.sprite_index, new Point(zp.x, zp.y)); Image arrow; if (zp.sprite_index == spr_green_zpoint) { arrow = spr_green_arrows[zp.image_index]; } else if (zp.sprite_index == spr_red_zpoint) { arrow = spr_red_arrows[zp.image_index]; } else { arrow = spr_grey_arrows[zp.image_index]; } g.DrawImage(arrow, new Point(zp.x - 4, zp.y - 4)); } } } if (latest_p1 != -1 && latest_p2 != -1) { ZPoint zp = zpoints[latest_p1, latest_p2]; if (zp != null) { g.DrawImage(spr_focus, new Point(zp.x - 6, zp.y - 6)); } }

    Read the article

  • Adding controls dynamically at design time vb.net

    - by chris
    I have been developing some custom smart tags. I am using a DesignerActionMethodItem which gets me to a fired method in code. When I try to hit the controls.Add the control is added but it seems the designer is unaware of it. It is never serialized and it goes away when the form is refreshed in the designer. Any help would be greatly appreciated. I am sort of stuck and google hasn't helped me. Please don't send me anything about smart tags that has nothing to do with adding controls dynamically at design time, I have already read so many looking for this.

    Read the article

  • When I try to show an image on linklabel click, I get an error

    - by JB
    When I try to show an image on linklabel click, I get an error: unrecognized escape sequence. Code: public void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start( "mspaint~C:\Users\Joshua Banks\Desktop\Downtown_atlanta_night.jpg"); }

    Read the article

  • How do I Data-Bind dual DateTimePicker to a single DateTime object

    - by S.C. Madsen
    Hi, I have a simple form, with two DateTimePicker-controls: One for date, and one for time. The thing is these two controls are supposed to represent a single point in time. Hence I would like to "Bind" them to a single DateTime property on my form (for simplicity). I did the following: // Start is a DateTime property on the form _StartDate.DataBindings.Add("Value", this, "Start"); _StartTime.DataBindings.Add("Value", this, "Start"); But hooking into "ValueChanged" event, yields mixed results... Sometimes I get exactly what I want, sometimes the updates of the property are "sluggish". I figured this way of splitting into two DateTimePicker's was fairly common. So how to do it? Update: There is possibly multiple questions in there: How do I bind a DateTimePicker (Format: Date) to a DateTime Property on a form? Then, how do I bind yet another DateTimePicker (Format: Time) to the same property? I'm using Visual Studio Express 2008 (.NET 3.5), and I seemingly get ValueChanged events from the DateTimePickers before the value is changed?

    Read the article

  • MDI Child form over a graphics

    - by Poco
    How to show a MDI child form over a graphics control (created from a Panel's CreateGraphics method, for instance) in a MDI Parent control. The MDI Parent graphics control gets over the MDI Child form.

    Read the article

  • Recommendations for a Hex Viewer Control for Windows.Forms?

    - by Fred F.
    I need ability to display content in Hex View, like this from WinHex Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 EF BB BF 0D 0A 4D 69 63 72 6F 73 6F 66 74 20 56 ..Microsoft V 00000010 69 73 75 61 6C 20 53 74 75 64 69 6F 20 53 6F 6C isual Studio Sol 00000020 75 74 69 6F 6E 20 46 69 6C 65 2C 20 46 6F 72 6D ution File, Form 00000030 61 74 20 56 65 72 73 69 6F 6E 20 31 30 2E 30 30 at Version 10.00 00000040 0D 0A 23 20 56 69 73 75 61 6C 20 53 74 75 64 69 ..# Visual Studi 00000050 6F 20 32 30 30 38 0D 0A 50 72 6F 6A 65 63 74 28 o 2008..Project( 00000060 22 7B 46 31 38 34 42 30 38 46 2D 43 38 31 43 2D "{F184B08F-C81C- 00000070 34 35 46 36 2D 41 35 37 46 2D 35 41 42 44 39 39 45F6-A57F-5ABD99 Please recommend a control. Thank you.

    Read the article

  • Access Edit Mode Values of BindingSource Control

    - by Christopher Edwards
    I have a BindingSource control (http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.aspx) with a datasource of a (single) Linq object. If I change any of the properties of the underlying Linq-to-Sql object then all the other changes on the bound controls on the form are lost. Does anyone now why and how I work around it? I don't want to call EndEdit because this will commit the changes to the underlying object. I think this might be because my underlying object linq-to-sql object does not implement IEditableObject so the potental new values for the object fields are sort of stored in the forms controls. Can anyone either clarify what is going on and/or suggest a work around. Thanks!

    Read the article

  • How to make a floating (tooltip) control in Windows.Forms?

    - by Daren Thomas
    The Scene: A (smallish) Form hosting a UserControl. The Plot: Whenever UserControl raises a hover event, display some (graphical) information in a tool tip fashion. When the user moves the mouse, fade them away again. Notes: I'd like to display more than one "tooltip", with each tooltip being a UserControl displaying information in a graphical manner. Not just text in a yellow box! Also, I'm using the Windows.Forms library.

    Read the article

  • Strongly Typed Controls in .NET

    - by Tigraine
    I am working on a Windows Forms app for quite some time now, and I really find myself doing more typecasts in the GUI code than I ever did in my underlying business code. What I mean becomes apparent if you watch the ComboBox control that accepts some vague "object" as it's item. Then you go off and may display some DisplayMember and a ValueMember and so on. If I want to retrieve that value later I need to typecast my object back to what it was. Like with strings getting the value takes string value = (string)combobox1.SelectedItem; Since there are generics in the Framework for quite some time now, I still wonder why in the Hell not one control from the standard toolbox is generic. I also find myself using the .Tag property on ListViewItems all the time to keep the displayed domain object. But everytime I need to access that object I then need another typecast. Why cant I just create a ComboBox or ListView with items of type ListViewItem Am I missing something here or is this just another example of not perfectly well thought through controls?

    Read the article

  • Why .NET does not allow cross-thread operations?

    - by RHaguiuda
    This question is not about what is a cross-thread operation, and how to avoid it, but why internal mechanics of .NET framework does not allow a cross-thread operation. I can`t understand why a SerialPort DataReceived event cannot update a simple text box on my form and why using delegates this is possible?

    Read the article

  • Resize WinForm, with no border?

    - by Dodi300
    Does anyone know how I can resize a winform when it has no border. I don't want the default border that Windows has, so I changed the property "FormBorderStyle" to "None". This removed the border, although now it can't be resized. I've figured out how to move the form around, I just need to know how to resize it.

    Read the article

  • Locked DataGridView. Linq is a problem ?

    - by phenevo
    Hi, I get the collection from webservice: var allPlaceHolders = (from ph in new MyService().GetPlaceHolders() select ph).Select(l => new { Code = l.Code, Name = l.Name, Related = false }).ToList(); dgPlaceHoldersAdd.DataSource = allPlaceHolders; Designer.cs: this.dgPlaceHoldersAdd.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgPlaceHoldersAdd.Location = new System.Drawing.Point(3, 54); this.dgPlaceHoldersAdd.Name = "dgPlaceHoldersAdd"; this.dgPlaceHoldersAdd.RowHeadersVisible = false; this.dgPlaceHoldersAdd.Size = new System.Drawing.Size(286, 151); this.dgPlaceHoldersAdd.TabIndex = 15; The problem is, that I can't changing value of checkBox column. I has enabled AutoGeneratedColumns (In datagridview at start there is not any column)

    Read the article

  • What points to be used for Drawing Hexagonal Shaped Button

    - by Durga
    Using below code I am able to draw arrow shaped button(shown below) ,but I want to draw hexagone(shown below as result image) ,so that I can use png image of size 175x154 as button image ,What Points I need to use to draw this ? and i need to to draw 6 such buttons ,how do i achieve this ? private void Parent_Load(object sender, EventArgs e) { // Define the points in the polygonal path. Point[] pts = { new Point( 20, 60), new Point(140, 60), new Point(140, 20), new Point(220, 100), new Point(140, 180), new Point(140, 140), new Point( 20, 140) }; // Make the GraphicsPath. GraphicsPath polygon_path = new GraphicsPath(FillMode.Winding); polygon_path.AddPolygon(pts); // Convert the GraphicsPath into a Region. Region polygon_region = new Region(polygon_path); // Constrain the button to the region. btnExam.Region = polygon_region; // Make the button big enough to hold the whole region. btnExam.SetBounds( btnExam.Location.X, btnExam.Location.Y, pts[3].X + 5, pts[4].Y + 5); }

    Read the article

  • Is there a way to get different sizes of the Windows system icons in .NET?

    - by Andrew Watt
    In particular I'd like to be able to get the small (16 x 16) icons at runtime. I tried this: new Icon(SystemIcons.Error, SystemInformation.SmallIconSize) Which supposedly "attempts to find a version of the icon that matches the requested size", but it's still giving me a 32 x 32 icon. I also tried: Size iconSize = SystemInformation.SmallIconSize; Bitmap bitmap = new Bitmap(iconSize.Width, iconSize.Height); using (Graphics g = Graphics.FromImage(bitmap)) { g.DrawIcon(SystemIcons.Error, new Rectangle(Point.Empty, iconSize)); } But that just scales the 32 x 32 icon down into an ugly 16 x 16. I've considered just pulling icons out of the VS Image Library, but I really want them to vary dynamically with the OS (XP icons on XP, Vista icons on Vista, etc.). I'm willing to P/Invoke if that's what it takes.

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >