Click here to Skip to main content
15,886,258 members
Home / Discussions / C#
   

C#

 
AnswerRe: Stretching a polygon side in C# Pin
Yoyosch20-Sep-05 4:06
Yoyosch20-Sep-05 4:06 
GeneralRe: Stretching a polygon side in C# Pin
subramanyeswari20-Sep-05 17:43
subramanyeswari20-Sep-05 17:43 
AnswerRe: Stretching a polygon side in C# Pin
Andy Moore20-Sep-05 18:15
Andy Moore20-Sep-05 18:15 
GeneralRe: Stretching a polygon side in C# Pin
subramanyeswari21-Sep-05 17:30
subramanyeswari21-Sep-05 17:30 
QuestionVisual Studio tools for Office Pin
Giannis Zetas20-Sep-05 3:15
Giannis Zetas20-Sep-05 3:15 
AnswerRe: Visual Studio tools for Office Pin
NassosReyzidis20-Sep-05 3:31
NassosReyzidis20-Sep-05 3:31 
QuestionProgrammatically showing and hiding a scollbar in a multiline textbox Pin
Dan Neely20-Sep-05 3:07
Dan Neely20-Sep-05 3:07 
Questionoverride Paint method for DataGrid Pin
zaboboa20-Sep-05 2:52
zaboboa20-Sep-05 2:52 
Hello, I have this simple Paint method for my datagrid:

protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight) <br />
       { <br />
          DataRowView view = (DataRowView) source.Current;<br />
          System.Drawing.Color myColour = Color.White;<br />
          numberFormatInfo = new NumberFormatInfo();<br />
	      numberFormatInfo.CurrencySymbol = "$";<br />
	      numberFormatInfo.NumberDecimalDigits = 0;<br />
	      numberFormatInfo.CurrencyDecimalDigits = 0;<br />
	      numberFormatInfo.CurrencyNegativePattern = 1;<br />
          <br />
          string[] str = view.DataView.Table.Rows[rowNum]["IndentLevel"].ToString().Split('~');<br />
          <br />
// HERE IS THE PROBLEM--------<br />
/*<br />
          if (rowNum < 4) {<br />
             this.Format = "n";<br />
             this.FormatInfo = numberFormatInfo;<br />
          } else {<br />
             this.Format = "c";<br />
             this.FormatInfo = numberFormatInfo;<br />
          } <br />
          */<br />
          <br />
          <br />
          <br />
          // --- Main Heading ---<br />
          if (str.Length == 1) {<br />
             myColour = Color.Coral;<br />
          } else if (str.Length == 2) {<br />
             // --- Sub Headings ---<br />
             if (str[1] == "1" || str[1] == "4") {<br />
                myColour = Color.PaleGoldenrod;<br />
             // --- Net Sum Headings ---<br />
             } else if (str[1] == "7") {<br />
                myColour = Color.Lavender;<br />
             // --- Other Headings ---<br />
             } else {<br />
                myColour = Color.Wheat;<br />
             }<br />
          // --- Populated Rows ---<br />
          } else if (str.Length == 3) {<br />
             myColour = Color.SeaShell;<br />
          } else {<br />
             myColour = Color.Thistle;<br />
          }<br />
		  <br />
		  // ----------------------------<br />
		  // ------ Paint the Row -------<br />
		  // ----------------------------<br />
          try{ <br />
             backBrush = new SolidBrush(myColour); <br />
          } <br />
          catch(Exception) {} <br />
          finally {<br />
             base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight); <br />
          } <br />
       }


So, the commented out portion couses the datagrid to flicker, if it is inserted in the code, and other controls like buttons, etc.. don't show up on the form, unless you move the form. If it's commented out, everything is working smooth and fine. Any ideas?

Thank you
QuestionDialog box exit Pin
baronics20-Sep-05 2:37
baronics20-Sep-05 2:37 
AnswerRe: Dialog box exit Pin
Ashok Dhamija20-Sep-05 3:22
Ashok Dhamija20-Sep-05 3:22 
GeneralRe: Dialog box exit Pin
baronics20-Sep-05 4:58
baronics20-Sep-05 4:58 
QuestionC# ,Directx and MPEG2 encoding Pin
Member 242731820-Sep-05 2:33
Member 242731820-Sep-05 2:33 
QuestionOverhead Representation Pin
PHDENG8120-Sep-05 1:24
PHDENG8120-Sep-05 1:24 
AnswerRe: Overhead Representation Pin
Anonymous20-Sep-05 4:46
Anonymous20-Sep-05 4:46 
AnswerRe: Overhead Representation Pin
Anonymous20-Sep-05 4:46
Anonymous20-Sep-05 4:46 
QuestionCapturing Frames from a AVI File Pin
Balasubramanian_198020-Sep-05 1:00
Balasubramanian_198020-Sep-05 1:00 
AnswerRe: Capturing Frames from a AVI File Pin
Andrew Kirillov20-Sep-05 2:17
Andrew Kirillov20-Sep-05 2:17 
AnswerRe: Capturing Frames from a AVI File Pin
Andrew Kirillov20-Sep-05 3:42
Andrew Kirillov20-Sep-05 3:42 
QuestionHeader / Detail in c# Pin
dabuskol20-Sep-05 0:48
dabuskol20-Sep-05 0:48 
QuestionForm Controls Pin
deepscyberpulse20-Sep-05 0:24
deepscyberpulse20-Sep-05 0:24 
AnswerRe: Form Controls Pin
NanaAM20-Sep-05 0:58
NanaAM20-Sep-05 0:58 
AnswerRe: Form Controls Pin
Ashok Dhamija20-Sep-05 3:34
Ashok Dhamija20-Sep-05 3:34 
Question&quot;typeloadexception&quot; What is this? How i solve it? Pin
Campaniço20-Sep-05 0:13
Campaniço20-Sep-05 0:13 
AnswerRe: &quot;typeloadexception&quot; What is this? How i solve it? Pin
S. Senthil Kumar20-Sep-05 2:10
S. Senthil Kumar20-Sep-05 2:10 
Questionhow to hide a column in Data Grid Pin
Rizwan Bashir19-Sep-05 23:30
Rizwan Bashir19-Sep-05 23:30 

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.