Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have code for combo box selected index changed
every index change i called field on database to assign another label text
code like this:

C#
conn = Connection.GetInstance();
pixelRanges = pixeRangeDao.GetDataById(cbAreaCluster.SelectedIndex);
lbDescription.Text = pixeRanges.description.ToString;



the issue is
i need popup form or message while i clicked label lbDescription
and popud contain field which has relationship with cbAreaCluster.SelectedIndex

what kind of popup is the best?
how can i create it?
and how can i use the relation?
Posted
Comments
The14thNoah 17-Feb-14 0:15am    
what is the purpose of pop-up?is it just to notify the user that selected index was fired?
or you want the pop-up to do another algorithm?
gunkrr 17-Feb-14 1:31am    
just show another field on same table
ex : labelInfo.Text = information;

information i get from table which has id from cbAreaCluster.SelectedIndex
Malli_S 17-Feb-14 2:08am    
Do you want it Model or Modeless?
Did you try MessageBox.Show()?
The14thNoah 17-Feb-14 2:32am    
Malli_S was right,If it is just showing field only then use MessageBox.Show(information);

1 solution

i have to try refer attribute from another form and success
this is part of code

C#
public MainForm mainFormRef;
public int id;
private Connection conn;

public FormInformation(ref MainForm mainForm)
{
    mainFormRef = mainForm;
    InitializeComponent();
    loadData();
}

private void loadData()
{
    id = mainFormRef.id;

    //call information
    conn = Connection.GetInstance();
    var pixelRangeDao = new PixelRangeDao(conn.GetConnection());
    var pixelRanges = pixelRangeDao.GetDataById(id);

    lbHeader.Text = pixelRanges.description.ToString();
    lbInformation.Text = pixelRanges.information.ToString();
}
 
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