Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: random seeds? Pin
antrock10116-Mar-09 8:41
antrock10116-Mar-09 8:41 
GeneralRe: random seeds? Pin
antrock10116-Mar-09 14:16
antrock10116-Mar-09 14:16 
GeneralRe: random seeds? Pin
antrock10118-Mar-09 17:22
antrock10118-Mar-09 17:22 
QuestionSQL statement problem? Pin
Jon Henry14-Mar-09 11:43
Jon Henry14-Mar-09 11:43 
AnswerRe: SQL statement problem? Pin
Christian Graus14-Mar-09 11:45
protectorChristian Graus14-Mar-09 11:45 
Question[Message Deleted] Pin
jetspike14-Mar-09 10:49
jetspike14-Mar-09 10:49 
GeneralRe: Accessing datatable.rows on Form1 from From2 Pin
Luc Pattyn14-Mar-09 11:19
sitebuilderLuc Pattyn14-Mar-09 11:19 
AnswerRe: Accessing datatable.rows on Form1 from From2 Pin
Christian Graus14-Mar-09 11:51
protectorChristian Graus14-Mar-09 11:51 
QuestionImage Problem Pin
reza assar14-Mar-09 9:20
reza assar14-Mar-09 9:20 
AnswerRe: Image Problem Pin
Christian Graus14-Mar-09 9:31
protectorChristian Graus14-Mar-09 9:31 
AnswerRe: Image Problem Pin
Mohammad Dayyan14-Mar-09 11:25
Mohammad Dayyan14-Mar-09 11:25 
Questiondisplay image from SQL Server into Picture control Pin
Jassim Rahma14-Mar-09 7:31
Jassim Rahma14-Mar-09 7:31 
AnswerRe: display image from SQL Server into Picture control Pin
Luc Pattyn14-Mar-09 7:39
sitebuilderLuc Pattyn14-Mar-09 7:39 
AnswerRe: display image from SQL Server into Picture control Pin
Giorgi Dalakishvili14-Mar-09 7:43
mentorGiorgi Dalakishvili14-Mar-09 7:43 
AnswerRe: display image from SQL Server into Picture control Pin
Xmen Real 14-Mar-09 8:10
professional Xmen Real 14-Mar-09 8:10 
GeneralRe: display image from SQL Server into Picture control Pin
Jassim Rahma15-Mar-09 8:43
Jassim Rahma15-Mar-09 8:43 
GeneralRe: display image from SQL Server into Picture control Pin
Xmen Real 15-Mar-09 15:36
professional Xmen Real 15-Mar-09 15:36 
QuestionDynamic buttons in flowlayout panel Pin
Jon Henry14-Mar-09 7:08
Jon Henry14-Mar-09 7:08 
Im creating multiple buttons based on artists from a database. i am creating the buttons perfectly but have a problem assigning click events to individual buttons. I want to be able to click a button and open another form with the info and songs from the artist that was on that particular button.

I am an amateur programmer(lol), so dont ride me too bad if the solution is painfully obvious.

public partial class frmSearchArtists : Form
    {
        OleDbConnection musLibConn = new OleDbConnection();
        utility util = new utility();
        string artist;
        int i = 0;

        public frmSearchArtists()
        {
            InitializeComponent();
            musLibConn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\GeneSys\Library.mdb";
            musLibConn.Open();

            OleDbCommand selLib = new OleDbCommand("SELECT DISTINCT Artist FROM Library ORDER BY Artist", musLibConn);
            OleDbDataReader drLib = selLib.ExecuteReader();
            int idxArtist = drLib.GetOrdinal("Artist");
            Button btn;

            while(drLib.Read())
            {
                
                btn = new Button();
                btn.Text = drLib.GetValue(idxArtist).ToString();
                artist = drLib.GetValue(idxArtist).ToString();
                btn.Name = artist;
                btn.ForeColor = Color.White;
                btn.Size = new System.Drawing.Size(120, 60);
                btn.BackColor = Color.MidnightBlue;
                btn.Font = new Font("Arial Black", 10, FontStyle.Bold);
                btn.Click += new System.EventHandler(this.btnArtist_click);
                flp.Controls.Add(btn);
                i++;
            }
        }

        private void btnArtist_click(object sender, EventArgs e)
        {
            util.setArtist(artist);
            frmArtist frmArtist = new frmArtist();
            frmArtist.Show();
        }
    }


Any ideas or just suggestions to make existing code better?
AnswerRe: Dynamic buttons in flowlayout panel Pin
N a v a n e e t h14-Mar-09 7:42
N a v a n e e t h14-Mar-09 7:42 
GeneralRe: Dynamic buttons in flowlayout panel Pin
Jon Henry14-Mar-09 7:59
Jon Henry14-Mar-09 7:59 
QuestionMS remote for Media Player Pin
electriac14-Mar-09 6:29
electriac14-Mar-09 6:29 
QuestionFormat date to system timezone Pin
Tony Pottier14-Mar-09 6:24
Tony Pottier14-Mar-09 6:24 
AnswerRe: Format date to system timezone Pin
Christian Graus14-Mar-09 8:15
protectorChristian Graus14-Mar-09 8:15 
QuestionPInvoke void * parameter Pin
Jason McPeak14-Mar-09 5:32
Jason McPeak14-Mar-09 5:32 
AnswerRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 5:56
sitebuilderLuc Pattyn14-Mar-09 5:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.