Click here to Skip to main content
15,907,395 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multiclient server application Pin
Frozzeg23-Aug-09 16:40
Frozzeg23-Aug-09 16:40 
QuestionSQL CONNECTION Pin
kibromg23-Aug-09 4:50
kibromg23-Aug-09 4:50 
AnswerRe: SQL CONNECTION Pin
Henry Minute23-Aug-09 5:08
Henry Minute23-Aug-09 5:08 
GeneralRe: SQL CONNECTION Pin
kibromg23-Aug-09 5:34
kibromg23-Aug-09 5:34 
GeneralRe: SQL CONNECTION Pin
Henry Minute23-Aug-09 5:48
Henry Minute23-Aug-09 5:48 
GeneralRe: SQL CONNECTION Pin
kibromg23-Aug-09 7:28
kibromg23-Aug-09 7:28 
GeneralRe: SQL CONNECTION Pin
Henry Minute23-Aug-09 7:46
Henry Minute23-Aug-09 7:46 
QuestionTime Picker Problem* Pin
Lyon Sun23-Aug-09 4:17
Lyon Sun23-Aug-09 4:17 
Hi, guys,
I am trying to get time by MouseDown and MouseUp events on a custom control with several picture boxes on it. Since e.X and e.Y can be taken when those two events occur, I create a method in that custom control called getTimeAt(int x, int y). The code of this method is as follows:
public DateTime getTimeAt(int x, int y)
        {
            DateTime selectedTime = new DateTime();
            Random rnd=new Random();

            int hour = (y - 10) / 20 + 7;
            int minute = (x - 25) / 50 * 10+rnd.Next(1,9);
           
            if (minute>59)
            {
                minute = 59;
            }

            selectedTime = DateTime.Today;
            selectedTime = selectedTime.AddHours(hour);
            selectedTime = selectedTime.AddMinutes(minute);

            

            return selectedTime;
        }

However, this doesn't work the same way as I expected. When I initiated one object of this custom control in a winform, and made a test app, do it as the following code,
private void selectorControl1_MouseDown(object sender, MouseEventArgs e)
       {
           maskedTextBox1.Text = selectorControl1.getTimeAt(e.X, e.Y).ToString("hhmm");
       }
it didn't get the e.X and e.Y from those picture boxes but only from that custom control. Anyone knows what's wrong here? Or does anybody have a better idea to solve my problem?
Thank you!
AnswerRe: Time Picker Problem* Pin
riced23-Aug-09 5:11
riced23-Aug-09 5:11 
GeneralRe: Time Picker Problem* Pin
Lyon Sun23-Aug-09 21:19
Lyon Sun23-Aug-09 21:19 
Questionhow do i disable the close button in a windows form Pin
Vivek Vijayan23-Aug-09 1:57
Vivek Vijayan23-Aug-09 1:57 
AnswerRe: how do i disable the close button in a windows form Pin
OriginalGriff23-Aug-09 2:21
mveOriginalGriff23-Aug-09 2:21 
QuestionHow can I access to objects in a third-party application? Pin
m.samar23-Aug-09 0:40
m.samar23-Aug-09 0:40 
AnswerRe: How can I access to objects in a third-party application? Pin
Luc Pattyn23-Aug-09 0:55
sitebuilderLuc Pattyn23-Aug-09 0:55 
GeneralRe: How can I access to objects in a third-party application? Pin
m.samar23-Aug-09 1:35
m.samar23-Aug-09 1:35 
GeneralRe: How can I access to objects in a third-party application? Pin
Luc Pattyn23-Aug-09 1:47
sitebuilderLuc Pattyn23-Aug-09 1:47 
GeneralRe: How can I access to objects in a third-party application? Pin
m.samar23-Aug-09 2:40
m.samar23-Aug-09 2:40 
GeneralRe: How can I access to objects in a third-party application? Pin
Richard MacCutchan25-Aug-09 10:12
mveRichard MacCutchan25-Aug-09 10:12 
QuestionProducing video Pin
Muammar©22-Aug-09 23:14
Muammar©22-Aug-09 23:14 
Question64bit woes Pin
mav.northwind22-Aug-09 23:05
mav.northwind22-Aug-09 23:05 
AnswerRe: 64bit woes Pin
Luc Pattyn22-Aug-09 23:33
sitebuilderLuc Pattyn22-Aug-09 23:33 
GeneralRe: 64bit woes Pin
mav.northwind22-Aug-09 23:56
mav.northwind22-Aug-09 23:56 
Questionlast record is not deleted Pin
mahdi198422-Aug-09 21:10
mahdi198422-Aug-09 21:10 
QuestionWhat is the method in C# like the method - "repaint()" in JAVA??? Pin
TAFIN22-Aug-09 20:11
TAFIN22-Aug-09 20:11 
AnswerRe: What is the method in C# like the method - "repaint()" in JAVA??? Pin
stancrm22-Aug-09 20:19
stancrm22-Aug-09 20:19 

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.