Jump to content

C# Combobox Yardım


Woods
 Share

Recommended Posts

comboBoxtan bir değerin seçilmesini engellemek istiyorum mesela Edit Items'tan 'Seçiniz' diye bir alan ekledim ama bu sadece comboBox'ta yazıcak yani comboBoxı açtığımızda bu alanı seçemiyeceğiz bunu nasıl yapabilirim.Text olarak yazdım ama pek hoş olmadı

Link to comment
Share on other sites

direk bir yolunu göremedim ama şu yöntem iş görebilir:

 

combobox'un SelectedIndexChanged evresine:

if (comboBox1.SelectedIndex == 0)
{
    comboBox1.SelectedIndex = 1;
}

yazarsan 0 nolu yani ilk itemi seçmeyecek, bir sonrakine atlayacaktır. şunun gibi görünmeli:

 

O3MlTB4.png

Link to comment
Share on other sites

Yardımın için teşekkürler üstad bu işlemden sonra yeni bir sorun çıktı ama onu düzelttim form açıldığında 0. indexin seçili olması gerekiyordu ama bu yazdığımız kod'tan sonra 1.indexi seçiyordu onuda şöyle düzelttim belki birinin işine yarar

 

 

form1_Load

 

comboBox7.SelectedText = "SEÇİNİZ";

Link to comment
Share on other sites

bende yeni başladım visual c#'a, ilk defa birine yardım ediyorum :) takıldığın yerde sor hep beraber araştırır, öğrenir, çözeriz.


Text e yazarsanız bu şekilde görünür ve dediğiniz gibi oluyor seçilmiyor ancak yazıyor.

qOuhulN.png

 

evet bu da mantıklı bir yol. ya da formu kaydeden, gönderen buttona koşul koyulabilir.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...