Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Richard Deeming18-Oct-19 3:56
mveRichard Deeming18-Oct-19 3:56 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 4:05
sitebuilderLuc Pattyn18-Oct-19 4:05 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 4:09
professionalBillWoodruff18-Oct-19 4:09 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 4:19
sitebuilderLuc Pattyn18-Oct-19 4:19 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 3:54
professionalBillWoodruff18-Oct-19 3:54 
AnswerRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Bernhard Hiller20-Oct-19 22:35
Bernhard Hiller20-Oct-19 22:35 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff21-Oct-19 1:01
professionalBillWoodruff21-Oct-19 1:01 
QuestionCan I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846717-Oct-19 17:42
Member 245846717-Oct-19 17:42 
I want to convert EventArgs type to PaintEventArgs type, cast button_click to form_paint, how do I write code ? You see my error code
C#
namespace DrawText_Random
{
    public partial class Form2 : Form
    {        
        public Form2()
        {
            InitializeComponent();
            //progressBar1.Visible = false;
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;

            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form9_Paint);

        }

        int valueforShadowedTextPaint = 0;
        private void btnDrawText_Click(object sender, EventArgs e) //PaintEventArgs e
        {
            progressBar1.Value = 0;
            this.timer1.Interval = 100;
            this.timer1.Enabled = true;            

        }

        private void ShadowedTextPaint(PaintEventArgs e, int num) 
        {            
            // Set up the font
            Font fnt = new Font("Calibri", 296, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point);

            // Get the Form's Graphics object
            Graphics g = e.Graphics;

            // Draw background text
            g.DrawString(num.ToString(), fnt, Brushes.DarkGray, 244, 104);

            // Draw main text slightly offset from shadow text
            g.DrawString(num.ToString(), fnt, Brushes.Aqua, 240, 100);

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (progressBar1.Value < 100)
            {
                PaintEventArgs g = (PaintEventArgs)e;//Error here: Unable to cast object of type 'System.Windows.Forms.MouseEventArgs' to type 'System.Windows.Forms.PaintEventArgs'.
                Random rd = new Random();
                Random rd = new Random();
                int Number = rd.Next(0, 999);               
                //This place must call ShadowedTextPaint (...) function to jump continuously 
                ShadowedTextPaint(e, Number);                
                progressBar1.Value++;
            }
            else
            {
                this.Invalidate(); 
                this.timer1.Enabled = false;
            }
        }

    }
}

AnswerRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 20:09
mveOriginalGriff17-Oct-19 20:09 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846717-Oct-19 22:14
Member 245846717-Oct-19 22:14 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 22:36
mveOriginalGriff17-Oct-19 22:36 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846721-Oct-19 17:03
Member 245846721-Oct-19 17:03 
QuestionUpdating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx17-Oct-19 12:50
professionaljkirkerx17-Oct-19 12:50 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Luc Pattyn17-Oct-19 16:09
sitebuilderLuc Pattyn17-Oct-19 16:09 
GeneralRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx18-Oct-19 6:27
professionaljkirkerx18-Oct-19 6:27 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Richard Deeming18-Oct-19 1:44
mveRichard Deeming18-Oct-19 1:44 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Richard Deeming18-Oct-19 2:02
mveRichard Deeming18-Oct-19 2:02 
GeneralRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx18-Oct-19 6:41
professionaljkirkerx18-Oct-19 6:41 
AnswerI don't get this with IndexOf not finding the record Pin
jkirkerx18-Oct-19 8:24
professionaljkirkerx18-Oct-19 8:24 
SuggestionNeed help wind form code Pin
AlexJo198516-Oct-19 22:11
AlexJo198516-Oct-19 22:11 
GeneralRe: Need help wind form code Pin
dan!sh 16-Oct-19 23:17
professional dan!sh 16-Oct-19 23:17 
GeneralRe: Need help wind form code Pin
Luc Pattyn17-Oct-19 15:41
sitebuilderLuc Pattyn17-Oct-19 15:41 
AnswerRe: Need help wind form code Pin
Richard Deeming18-Oct-19 1:32
mveRichard Deeming18-Oct-19 1:32 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 1:44
sitebuilderLuc Pattyn18-Oct-19 1:44 
GeneralRe: Need help wind form code Pin
Richard Deeming18-Oct-19 3:03
mveRichard Deeming18-Oct-19 3:03 

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.