不在C#中的.cs文件中访问datetimepicker [英] Not accessing datetimepicker in .cs file in C#

查看:108
本文介绍了不在C#中的.cs文件中访问datetimepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的!

i正在开发一个使用datetimepikcer保存一些时间的应用程序。

但问题是。

i我不能在.cs文件中访问datetimepicker名称或其值。



如果有任何想法请求帮助



THANX



M USman

hi dear!
i am developing an application to save some timings using datetimepikcer.
but the issue is.
i am not able to access datetimepicker name or its value in .cs file.

if any idea pleas help

THANX

M USman

推荐答案



我认为那些会帮助你



Windows解决方案:



Hi,
I think those will help you

Solution in Windows :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TimePickerApplication
{
    public class Form1 : Form
    {
        public Form1()
        {
            InitializeTimePicker();
        }
        private DateTimePicker timePicker;

        private void InitializeTimePicker()
        {
            timePicker = new DateTimePicker();
            timePicker.Format = DateTimePickerFormat.Time;
            timePicker.ShowUpDown = true;
            timePicker.Location = new Point(10, 10);
            timePicker.Width = 100;
            Controls.Add(timePicker);
        }
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

    }
}





网上解决方案



DateTimePicker Web Control [ ^ ]


你好亲爱的,我发现了确切的问题。
物品窗口中的
我选择了物业



GenerateMember = false
当我设置此属性时




GenerateMember = true



i我可以在.cs文件中访问它。



thanx用于帮助



spec than than to

Suvabrata Roy
Hi dear i found what the exact issue was.
in properties window i select the property

GenerateMember=false
when i set this property true

GenerateMember=true

i am able to access this in .cs file.

thanx for helping

specail thanx to
Suvabrata Roy


是的,亲爱的,不是。



你的答案是100%正确

我也试过这样的工作但问题是



W hy我无法访问使用工具添加的datetimepicker值(拖放)。





Thanx
Yes dear thanx

you answer is 100% correct
I also tried like this it is working but the issue is

Why i am not able to access datetimepicker value which added using tools(drag drop).


Thanx


这篇关于不在C#中的.cs文件中访问datetimepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆