Click here to Skip to main content
16,004,882 members
Home / Discussions / C#
   

C#

 
QuestionTableAdapterManager.UpdateAll problem : [ Concurrency violation ] Pin
hdv21220-Apr-09 5:28
hdv21220-Apr-09 5:28 
QuestionIcon in a textbox Pin
edlanka20-Apr-09 4:56
edlanka20-Apr-09 4:56 
AnswerRe: Icon in a textbox Pin
Ian McCaul20-Apr-09 5:26
Ian McCaul20-Apr-09 5:26 
GeneralRe: Icon in a textbox Pin
edlanka20-Apr-09 5:33
edlanka20-Apr-09 5:33 
GeneralRe: Icon in a textbox Pin
Ian McCaul20-Apr-09 5:40
Ian McCaul20-Apr-09 5:40 
GeneralRe: Icon in a textbox Pin
edlanka20-Apr-09 6:49
edlanka20-Apr-09 6:49 
GeneralRe: Icon in a textbox Pin
Mbah Dhaim20-Apr-09 7:15
Mbah Dhaim20-Apr-09 7:15 
GeneralRe: Icon in a textbox Pin
DaveyM6920-Apr-09 8:52
professionalDaveyM6920-Apr-09 8:52 
You could do something like this. Not perfect or complete but should be a start.
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

public class BusyTextBox : TextBox
{
    private Image busyImage;
    private bool isBusy;

    public Image BusyImage
    {
        get { return busyImage; }
        set { busyImage = value; }
    }

    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
    Browsable(false)]
    public bool IsBusy
    {
        get { return isBusy; }
        private set
        {
            isBusy = value;
            if (value)
            {
                using (Graphics g = this.CreateGraphics())
                {
                    // draw image
                    // g.DrawImage(busyImage,
                }
            }
            else
            {
                Invalidate();
            }
        }
    }

    protected override void OnTextChanged(EventArgs e)
    {
        IsBusy = true;
        // Do Your DB Stuff
        base.OnTextChanged(e);
        IsBusy = false;
    }
}
Make sure you dispose of the busyImage if not null when the BusyTextBox is disposed!

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Icon in a textbox Pin
Naruki20-Apr-09 17:43
Naruki20-Apr-09 17:43 
Questionhow 2 create a software Pin
dauu20-Apr-09 4:12
dauu20-Apr-09 4:12 
AnswerRe: how 2 create a software Pin
Pete O'Hanlon20-Apr-09 4:13
mvePete O'Hanlon20-Apr-09 4:13 
AnswerRe: how 2 create a software Pin
Colin Angus Mackay20-Apr-09 4:15
Colin Angus Mackay20-Apr-09 4:15 
GeneralRe: how 2 create a software Pin
MidwestLimey20-Apr-09 5:15
professionalMidwestLimey20-Apr-09 5:15 
GeneralRe: how 2 create a software Pin
Luc Pattyn20-Apr-09 5:20
sitebuilderLuc Pattyn20-Apr-09 5:20 
GeneralRe: how 2 create a software Pin
OriginalGriff20-Apr-09 5:23
mveOriginalGriff20-Apr-09 5:23 
GeneralRe: how 2 create a software Pin
Mycroft Holmes20-Apr-09 14:34
professionalMycroft Holmes20-Apr-09 14:34 
GeneralRe: how 2 create a software Pin
Naruki20-Apr-09 17:45
Naruki20-Apr-09 17:45 
GeneralRe: how 2 create a software Pin
PIEBALDconsult20-Apr-09 10:40
mvePIEBALDconsult20-Apr-09 10:40 
AnswerRe: how 2 create a software Pin
Michael Bookatz20-Apr-09 4:29
Michael Bookatz20-Apr-09 4:29 
AnswerRe: how 2 create a software Pin
benjymous20-Apr-09 4:38
benjymous20-Apr-09 4:38 
AnswerRe: how 2 create a software Pin
0x3c020-Apr-09 4:40
0x3c020-Apr-09 4:40 
AnswerRe: how 2 create a software Pin
OriginalGriff20-Apr-09 5:21
mveOriginalGriff20-Apr-09 5:21 
JokeRe: how 2 create a software Pin
DaveyM6920-Apr-09 6:03
professionalDaveyM6920-Apr-09 6:03 
GeneralRe: how 2 create a software Pin
OriginalGriff20-Apr-09 6:25
mveOriginalGriff20-Apr-09 6:25 
GeneralRe: how 2 create a software Pin
DaveyM6920-Apr-09 6:31
professionalDaveyM6920-Apr-09 6:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.