Results 1 to 7 of 7

Thread: [RESOLVED] [2005] C# -> Vb.net

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    Resolved [RESOLVED] [2005] C# -> Vb.net

    Code:
    public class MyVistaDateEditCalendar : VistaDateEditCalendar
        {
            public MyVistaDateEditCalendar(RepositoryItemDateEdit item, object editDate) : base(item, editDate) { }
    
            protected override void Init()
            {
                base.Init();
                this.View = DateEditCalendarViewType.YearInfo;
            }
    
            public override void OnItemClick(DevExpress.XtraEditors.Calendar.CalendarHitInfo hitInfo)
            {
                DayNumberCellInfo cell = hitInfo.HitObject as DayNumberCellInfo;
                if (View == DateEditCalendarViewType.YearInfo)
                {
                    DateTime dt = new DateTime(DateTime.Year, cell.Date.Month, CorrectDay(DateTime.Year, cell.Date.Month, DateTime.Day), DateTime.Hour, DateTime.Minute, DateTime.Second);
                    OnDateTimeCommit(dt, false);
                }
                else
                    base.OnItemClick(hitInfo);
            }
        }
    
    public class MyVistaPopupDateEditForm : VistaPopupDateEditForm
        {
            public MyVistaPopupDateEditForm(DateEdit ownerEdit) : base(ownerEdit) { }
            protected override DateEditCalendar CreateCalendar() {
                return new MyVistaDateEditCalendar(OwnerEdit.Properties, OwnerEdit.EditValue);
            }
        }
    
    public class MyDateEdit : DateEdit
        {
            protected override PopupBaseForm CreatePopupForm()
            {
                if (Properties.VistaDisplayMode == DevExpress.Utils.DefaultBoolean.True)
                    return new MyVistaPopupDateEditForm(this);
                return new PopupDateEditForm(this);
            }
        }
    What it does is takes a date editor and stops it from going to the day view, but selects the month. It is using Developer Express, but I really just don't understand the syntax of C#.
    Last edited by NPassero; Aug 7th, 2007 at 10:51 AM. Reason: c sharp, not c.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width