Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
Questionreading a xml document from a listview Pin
laziale12-Jun-08 23:22
laziale12-Jun-08 23:22 
AnswerRe: reading a xml document from a listview [modified] Pin
leppie12-Jun-08 23:30
leppie12-Jun-08 23:30 
AnswerRe: reading a xml document from a listview Pin
Eslam Afifi12-Jun-08 23:34
Eslam Afifi12-Jun-08 23:34 
QuestionBandwith Monitoring Pin
amilapradeep12-Jun-08 23:17
amilapradeep12-Jun-08 23:17 
AnswerRe: Bandwith Monitoring Pin
leppie12-Jun-08 23:28
leppie12-Jun-08 23:28 
GeneralRe: Bandwith Monitoring Pin
amilapradeep13-Jun-08 1:45
amilapradeep13-Jun-08 1:45 
QuestionGetting outlook items in the webpage Pin
manikandanid12-Jun-08 23:13
manikandanid12-Jun-08 23:13 
QuestionEvent issue in custom control Pin
Harvey Saayman12-Jun-08 22:56
Harvey Saayman12-Jun-08 22:56 
Hey guys,

im busy workin on a control, all it realy does is draw a time line and it has 6 masked text boxes aswell. the user must input 6 times and when the control's masked text boxes are filled in correctly i need it to fire an event so that a 2nd control can be given the values of this timeline control.

now i got the event working from within the control, my question is how do i give the form access to the event? maby im just missing something small, but to be honest delegates & events frighten me Laugh | :laugh:

public partial class TimeLine : UserControl
{
    public delegate void myDelegate(object sender, EventArgs args);
    public static event myDelegate dataCorrect;

    public TimeLine()
    {
        InitializeComponent();
        dataCorrect += new myDelegate(TimeLine_dataCorrect);
    }

    void TimeLine_dataCorrect(object sender, EventArgs args)
    {
        MessageBox.Show("YaY - Event Raised From Within Control");
    }


further down in a common event handler (Text Changed) used by all 6 masked text boxes i do this

try
{
    //
    // try to parse the values 
    //
    TimeSpan startTime = TimeSpan.Parse(mtxtStart.Text);
    TimeSpan endTime = TimeSpan.Parse(mtxtEnd.Text);
    
    //
    // and so on and so forth
    //

    //
    // if no FormatException was thrown the data must be correct there for trigger the event.
    //

    dataCorrect(this, new EventArgs());
}
catch (FormatException)
{
    //
    // if formatException occurs, do nothing because the user might still be typing in the text
    // boxes
    //    
}



thanx

Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)

AnswerRe: Event issue in custom control Pin
leppie12-Jun-08 23:39
leppie12-Jun-08 23:39 
GeneralRe: Event issue in custom control Pin
Harvey Saayman13-Jun-08 0:01
Harvey Saayman13-Jun-08 0:01 
Questiondefault comparer Pin
George_George12-Jun-08 22:54
George_George12-Jun-08 22:54 
AnswerRe: default comparer Pin
Simon P Stevens12-Jun-08 23:04
Simon P Stevens12-Jun-08 23:04 
GeneralRe: default comparer Pin
George_George12-Jun-08 23:22
George_George12-Jun-08 23:22 
GeneralRe: default comparer Pin
leppie12-Jun-08 23:29
leppie12-Jun-08 23:29 
GeneralRe: default comparer Pin
George_George15-Jun-08 3:35
George_George15-Jun-08 3:35 
Questionexport data from database(SQL Server 2000) to Excell Pin
thucnv12-Jun-08 22:06
thucnv12-Jun-08 22:06 
AnswerRe: export data from database(SQL Server 2000) to Excell Pin
Harvey Saayman12-Jun-08 22:25
Harvey Saayman12-Jun-08 22:25 
GeneralRe: export data from database(SQL Server 2000) to Excell Pin
thucnv12-Jun-08 23:06
thucnv12-Jun-08 23:06 
GeneralRe: export data from database(SQL Server 2000) to Excell Pin
Harvey Saayman12-Jun-08 23:13
Harvey Saayman12-Jun-08 23:13 
GeneralRe: export data from database(SQL Server 2000) to Excell Pin
thucnv12-Jun-08 23:26
thucnv12-Jun-08 23:26 
AnswerRe: export data from database(SQL Server 2000) to Excell Pin
Yosh_12-Jun-08 23:22
professionalYosh_12-Jun-08 23:22 
GeneralRe: export data from database(SQL Server 2000) to Excell Pin
thucnv12-Jun-08 23:46
thucnv12-Jun-08 23:46 
AnswerRe: export data from database(SQL Server 2000) to Excell Pin
Yosh_13-Jun-08 0:01
professionalYosh_13-Jun-08 0:01 
AnswerRe: export data from database(SQL Server 2000) to Excell Pin
Ashfield12-Jun-08 23:15
Ashfield12-Jun-08 23:15 
AnswerRe: export data from database(SQL Server 2000) to Excell Pin
c242313-Jun-08 1:15
c242313-Jun-08 1:15 

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.