Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sebrell

@Sebrell
About
Posts
16
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Datagridview not refreshing
    S Sebrell

    so much for the simple answer... I'm reminded of a similar problem I once had with a RichTextBox, where I needed to force it to redraw its scroll-bars. I solved that problem by writing a method along the lines of the following: (C# code, sorry) private void Jiggle() { if (this.Orientation == Orientation.Horizontal) { this.rtfBox.Width -= 3; this.rtfBox.Width += 3; } else { this.rtfBox.Height -= 3; this.rtfBox.Height += 3; } this.rtfBox.Invalidate(); } I then called this method from the method that needed to redraw the RichTextBox (which was a property setter for a container control). I was surprised how well it worked. Especially since the RichTextBox in question had its Dock property set to DockStyle.Fill. I'd suggest dynamically changing, by a small number of pixels (fewer than 8), the Width of one of the ColumnHeaders in your DataGridView, since it works when you click it. Or to change the Sort column to a different column, then back to the original column. HTH Sebrell -- modified at 14:30 Wednesday 18th October, 2006

    Visual Basic help question css announcement

  • Datagridview not refreshing
    S Sebrell

    Have you tried calling Control.Invalidate(), then calling Control.Update() ? The sequence of these two method calls should force the DataGridView to redraw itself.

    Visual Basic help question css announcement

  • g.DrawString to display floating point?
    S Sebrell

    You must specify the format by calling the System.Single.ToString(string format) overload.

    Standard numeric formats are listed on MSDN at Standard Numeric Format Strings.
    Custom numeric formatting is discussed at Custom Numeric Format Strings.

    C# graphics question

  • WinForms: programatically created control will not paint
    S Sebrell

    A thought: does your code call the Invalidate() method of the parent control? This method has multiple overloads, three of which take a boolean parameter "invalidateChildren".

    C# csharp help visual-studio winforms

  • Custom toolbar control in .Net framework
    S Sebrell

    This will be available with Whidbey, but there are also a couple examples here at CP for v1.1.

    .NET (Core and Framework) csharp dotnet help tutorial discussion

  • Dpi
    S Sebrell

    You can indeed set drawing units as inches (System.Drawing.GraphicsUnit.Point is 1/72 inch). Plus, you can get the DPI values from the System.Drawing.Graphics.DpiX and DpiY properties.

    C# graphics question

  • XmlNodes in a ListBox and junk...
    S Sebrell

    This is not a simple solution like the above, but it is easy to do in Visual Studio: get the schema for your documents, create a typed DataSet from the schema, use a dataset instance in your form, and set the appropriate table/column for the ListBox.DataSource and ListBox.DataMember properties.

    Just a thought.

    C# xml help question

  • TreeStructure problem
    S Sebrell

    you're very welcome. Also, I realize upon reading your last message why you need to convert the Point. The MouseEventArgs X and Y properties relate to screen co-ordinates. Controls use co-ordinates based on their parent control's ClientRectangle. The conversion forces the TreeView to determine the screen co-ordinates of its own ClientRectangle, which it otherwise has no need to know. I don't suppose you know a fast and reliable way to serialize rich text, do you?:)

    C# question help

  • findControl & checkbox state
    S Sebrell

    for question 1, are you searching for a Control whose Id value you set at design-time? that is, can you use document.getElementById(knownControlId) in client-side javascript? for question2, I'd try using <input type="hidden" id="ipt_[associated Image Id]" value="false" /> then use script (I'm big on client-side script) to handle the checkbox onclick event.

    function checkboxClicked(checkBox){

    var sId = checkBox.id;

    if (sId){

    // use a naming convention to convert to the id of the input

    var inputElem = document.getElementById(sId);

    if (inputElem && inputElem.value) {

    inputElem.value = "true";

    }

    }

    }

    Then add onclick="checkBoxClicked(this);" for each checkbox. This approach, although it relies on a naming convention, allows you to have access to the information on both server and client side. HTH

    C# question csharp asp-net docker help

  • Prevent killing an app through &quot;End task&quot;
    S Sebrell

    I'm really curious what you want this for.

    C# tutorial question

  • TreeStructure problem
    S Sebrell

    I forgot to add that you might want to change the value of tvAlbums.FullRowSelect and see what effect that has.

    C# question help

  • TreeStructure problem
    S Sebrell

    In that case, a call to tvAlbums.SelectedNode.Bounds.Contains(new Point(e.X, e.Y)) should tell you whether the node was clicked.

    C# question help

  • TreeStructure problem
    S Sebrell

    Try checking the tvAlbums.SelectedNode property instead of calling GetNodeAt - does it give you the correct Node reference? whoops -- i mean "in addition to calling GetNodeAt"

    C# question help

  • TreeStructure problem
    S Sebrell

    Or, the other way around, you can inherit from TreeView, create its nodes dynamically, and set each node's Tag property with an appropriate nested class instance.

    C# question help

  • TreeStructure problem
    S Sebrell

    You need a reference to the TreeView, and to set a TreeViewEventHandler for its AfterSelect event. TreeViewEventArgs has a Node property that returns the selected TreeNode.

    C# question help

  • Preventing multiple button clicks and process recursion
    S Sebrell

    I was about to post this when I read your reply. Decided to go ahead and post anyway. /// message Assuming you've assigned an EventHandler delegate from a private method on the Form to handle the Button's Click event, could you set a private flag, and test its value before launching the Process? Something like the pseudo-code below, so you can ignore the Button.Enabled property? (and so the Button doesn't have to know anything about the Process or the Form?)

    private void HandleButtonClick(object sender, EventArgs e){

    // at the beginning

    if (!this.canLaunch) return;

    // set the flag before launch

    this.canLaunch = false;

    Process targetProcess = new Process();

    // set EnableRaisingEvents

    targetProcess.EnableRaisingEvents = true;

    // assign exit event handler

    targetProcess.Exited += new EventHandler(this.TargetEnded);

    targetProcess.Start(...);

    }

    // process.Exited handler

    private void TargetEnded (object sender, EventArgs e){

    this.canLaunch = true;

    }

    // if other objects need to know:

    public bool LaunchEnabled {

    get { return this.canLaunch; }

    }

    HTH JSF

    C# data-structures question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups