Results 1 to 11 of 11

Thread: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Exclamation HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Hello everybody!
    i need your help for a code to change a combobox.text according the day.In my situation, i want to change only the Saturday and Sunday.
    I am beginner in coding and i didn't find any clues on the web or i don't have enough knowledge.thank you in advance for your answer.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Please provide a FULL and CLEAR explanation of what you're trying to achieve. What you have posted makes little sense.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    ok! i want to change the text from a combobox the saturday and sunday !
    for example:
    my combobox1.text= "fighters"
    my goal is only the saturday and sunday combobox1.text= "champion"
    thank you for your solution!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    It would seem to me that the actual question you want answered is how to determine whether the current day is a Saturday or Sunday, because you presumably know how to set a property, whether it's the Text of a ComboBox or anything else. Is that correct? If so, why didn't you ask that question? If not, what is the question you want answered?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Quote Originally Posted by jmcilhinney View Post
    It would seem to me that the actual question you want answered is how to determine whether the current day is a Saturday or Sunday, because you presumably know how to set a property, whether it's the Text of a ComboBox or anything else. Is that correct? If so, why didn't you ask that question? If not, what is the question you want answered?
    yes,you are right! how determine the day of week. i need a code. i am beginner to build program and i need some help and explications. this forum helped me a lot! i am grateful!

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    delete this message!
    Last edited by danzey; Mar 14th, 2020 at 04:29 PM.

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Code:
    If (Now.DayOfWeek.ToString = "Saturday")  Then

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Quote Originally Posted by wes4dbt View Post
    Code:
    If (Now.DayOfWeek.ToString = "Saturday")  Then
    Don't convert things to Strings unless you need a String, which you don't in this case. What type is that DayOfWeek property? Use that type:
    vb.net Code:
    1. If Date.Now.DayOfWeek = DayOfWeek.Saturday Then

  9. #9
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Don't convert things to Strings unless you need a String
    That sounds a lot like an ORDER. Now I will have to go out of way to convert everything I can to a String.

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    Quote Originally Posted by wes4dbt View Post
    That sounds a lot like an ORDER. Now I will have to go out of way to convert everything I can to a String.
    Clearly my reverse psychology is working.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Re: HELP! CHANGE THE COMBOBOX.TEXT ACCORDING THE DAY of week

    thank you so much! have a nice day!

Tags for this Thread

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