需要使用if语句进行评估的帮助. [英] Need help with evaluation using if statement.

查看:74
本文介绍了需要使用if语句进行评估的帮助.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了带有组(主页",日历"等)的Outlook样式导航栏.当用户更改这些组时,它将触发以下方法.使用该方法,我可以做两件事,首先检查以查看扩展了哪些组,其次是隐藏任何 不会扩展的视图.我不确定设置这种方法的正确方法是什么,但这是我想到的.我面临的问题是我不知道如何在程序启动时将对象(objCalendar)设置为null.
I have setup an outlook style navigation bar with groups (Home, Calendar, etc.). When the user changes these groups it triggers the following method. With the method I do two things, first check to see what group is expanded and the second is to hide any views that are not expanded. I'm not sure what the proper way is to setup such a method, but this is what I came up with. The problem I'm facing is I don't know how to set the objects (objCalendar) as null when the program starts up.

推荐答案

否则,如果"这是不正确的.因为,您在ShowCalendarView中创建objCalendarView.但是不会调用HideCalendarView,因为否则将不会执行.我认为应该是

I think "else if" is not correct here. Because, you create objCalendarView in ShowCalendarView. But HideCalendarView is not called because else if will not be executed. I think it should be,

  如果(navBarGroup1.Expanded == )
{
    ShowCalendarView();
}
如果(objCalendar!= )
{
    HideCalendarView();
}

 if (navBarGroup1.Expanded == true)
{
     ShowCalendarView();
}
if (objCalendar != null)
{
     HideCalendarView();
}

如果我忽略了这个问题,请原谅.

Please excuse me if I overlooked the problem.


这篇关于需要使用if语句进行评估的帮助.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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