Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi my codes in
form loading i change combobox values
but i want not run the combobox change codes

What I have tried:

VB
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
gün.Value = Date.Now.ToString("dd/MM/yyyy")
        yıl.Text = Year(Date.Now)
        ay.Text = MonthName(Month(Date.Now))



VB
Private Sub gün_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gün.ValueChanged
       veri_cek()

   End Sub
Posted
Updated 8-Oct-19 2:17am
v2

The ValueChanged-Event is allways raised if the Value changes - independant from when that happens.
But you could easyly prevent that for example with a Boolean Variable which disables the call from veri_cek when Form1_Load is running.
 
Share this answer
 
You can add or remove event handler whenever you want. See:
AddHandler Statement (Visual Basic) | Microsoft Docs[^]
RemoveHandler Statement (Visual Basic) | Microsoft Docs[^]
So, change Form_Load procedure accordingly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900