Forum: C# Oct 24th, 2009 |
| Replies: 9 Views: 480 I think you are stuck with Invoke because that is how C# moves the object pointer into the memory stack of the thread that wants to use it.
A little trick on sending the event to something that does... |
Forum: C# Oct 24th, 2009 |
| Replies: 9 Views: 480 If the receivers of the event absolutely must have the information back into thier own thread (like a Windows App sometimes does) then you would handle the invoke for arguments in those receiving... |
Forum: C# Aug 14th, 2009 |
| Replies: 2 Views: 765 I changed your code so that you can actually click on the other buttons.
public partial class Form1 : Form
{
private int controlnum = 0;
public Form1()
{
... |
Forum: C# Jul 6th, 2009 |
| Replies: 5 Views: 647 DataRow[] rows = yourTable.Select(string.Format("ID='{0}'",cbIDs.Text));
yourLabel.Text = (string)rows[0]["Name"]; |
Forum: C# Jun 16th, 2009 |
| Replies: 7 Views: 885 Maybe posting the rest of the code (or entire project) will help. The adapter.table is a bit of a mystery.
The acceptchanges is not really needed until later after the rows have all been added. I... |
Forum: C# May 13th, 2009 |
| Replies: 2 Views: 214 Place an Applicaiton.DoEvents(); inside of the loop so that the main thread has a chance to service its message queue and this should allow your label to update.
// Jerry |
Forum: C# May 8th, 2009 |
| Replies: 3 Views: 1,015 Make sure your DateTime value is enclosed in single quotes.
You might find it easier (to read and build) if you assemble the string using the string.Format() method.
SqlConnection conn = new... |
Forum: C# May 3rd, 2009 |
| Replies: 7 Views: 596 I don't think it is a wrong thing to say at all.
LinkedList<T> is a generic replacement for the old style coded Linked List. |
Forum: C# May 3rd, 2009 |
| Replies: 7 Views: 596 Maybe this link wil help you understand linked lists.
http://www.c-sharpcorner.com/UploadFile/jeradus/UsingLinkedListInCS11102005005525AM/UsingLinkedListInCS.aspx
Too bad they are still... |
Forum: C# May 3rd, 2009 |
| Replies: 2 Views: 975 Simple... Just set e.Handled to true
When e.Handled is set to true, then the keypress event stops there, otherwise it is passed up the chain to the TextBox.
// Jerry |
Forum: C# Apr 23rd, 2009 |
| Replies: 4 Views: 1,338 Please mark it as solved, only you can do that. |
Forum: C# Apr 23rd, 2009 |
| Replies: 4 Views: 1,338 ASP or WinForm ?
I can help if it is a Window Form... |
Forum: C# Apr 20th, 2009 |
| Replies: 6 Views: 2,033 Instead of using a private bool variable, use a private variable for Form2, then you have some options...
public partial class Form1 : Form
{
private Form2 _form2 = null;
... |
Forum: C# Apr 18th, 2009 |
| Replies: 6 Views: 1,089 Not exactly sure what you are asking for, but it is just a string, so you can concat the other textbox values into a single label using the (+) operator.
lblResult.Text = txtName.Text + " " +... |
Forum: C# Apr 17th, 2009 |
| Replies: 7 Views: 4,901 :)
You need to use the row not rows[0]
foreach (DataRow row in rows)
{
Console.Write("{0} ", row["ID"]; // rows[0]["ID"]);
... |
Forum: C# Apr 17th, 2009 |
| Replies: 7 Views: 4,901 The rows array contains all rows where column [First] = 'Lance' so all you need to do is iterate through the array of rows.
DataRow[] rows = table.Select("[First]='Lance'");
foreach(DataRow row... |
Forum: C# Apr 16th, 2009 |
| Replies: 7 Views: 4,901 To use the select, try this:
DataRow[] rows = table.Select("[First]='Lance'");
if(rows.Length > 0)
{
Console.Write("{0} ", rows[0]["ID"]);
Console.Write("{0} ", rows[0]["FIRST"]);... |
Forum: C# Apr 12th, 2009 |
| Replies: 5 Views: 971 I have a project I downloaded from Code Project called fun with animation. It has 100 animations running on a background image with no flicker.
(animation.zip) is attached.
I think the key to it is... |
Forum: C# Apr 11th, 2009 |
| Replies: 5 Views: 971 Are you using double buffering ? |
Forum: C# Apr 7th, 2009 |
| Replies: 38 Views: 2,039 Welcome, its nice to be able to help and work on something other than the complex code I typically deal with everyday in my job.
Yes you can have multiple forms and navigate between them using... |
Forum: C# Apr 6th, 2009 |
| Replies: 11 Views: 929 |
Forum: C# Apr 6th, 2009 |
| Replies: 38 Views: 2,039 Okay,
You wanted lines... You got Lines :)
Add this Paint event handler to your panel's Paint event.
private void panel_Paint(object sender, PaintEventArgs e)
{
int... |
Forum: C# Apr 6th, 2009 |
| Replies: 6 Views: 614 I am thinking that isMkvTest is null.
You can test for that by changing:
if (isMkvTest.Trim().Length != 0)
change to:
if( !string.IsNullOrEmpty( isMkvTest ) ) |
Forum: C# Apr 6th, 2009 |
| Replies: 38 Views: 2,039 lbl.ForeColor = lbl.AllowDrop ? Color.Blue : Color.Black;
That is what we call short cut code. It comes from the old days when we had the IIF statement. your assumption is correct, the first segment... |
Forum: C# Apr 6th, 2009 |
| Replies: 38 Views: 2,039 Yes Try..Catch and Try..Finally are basic code blocks available in all projects for c#.
I will find another way to send you the zip file. I made a few changes so that the numbers are centered in... |
Forum: C# Apr 6th, 2009 |
| Replies: 6 Views: 614 Have you used debug to trace to the actual line that crashes ?
I would venture to guess that it is at the line:
string isMkv = isMkvTest.Substring(isMkvTest.LastIndexOf(':'));
There is no... |
Forum: C# Apr 5th, 2009 |
| Replies: 38 Views: 2,039 Okay
Got the project.
Below is the Clear button event handler.
An explanation follows.
private void btnclr_Click(object sender, EventArgs e)
{
Label lbl; |
Forum: C# Apr 5th, 2009 |
| Replies: 38 Views: 2,039 JooClops,
Hope you live in a safe area of Israel.
It appears that you just copy paste'd the console methods into the Check button handler. That won't work.
You have three methods that are... |
Forum: C# Apr 4th, 2009 |
| Replies: 2 Views: 446 You can set the Modifier property of the DataGridView in the second dialog box to public. Then if the dialog result is Ok, then you can access the selected row of the DataGridView from your first... |
Forum: C# Apr 4th, 2009 |
| Replies: 2 Views: 388 ddanbe,
That line occurs because of the flat style being standard. During the click, the component base uses the drop effect which drops the top border into view.
Avoid that in the onPaint (or... |
Forum: C# Apr 4th, 2009 |
| Replies: 38 Views: 2,039 You need to move the declaration to the top of the class.
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
// Private class declarations
... |
Forum: C# Apr 4th, 2009 |
| Replies: 38 Views: 2,039 Okay,
No problem on the newB questions, everyone is a NewB at some point.
Does not look like you need to convert the text to integer, the (i+1) that you are assigning to the Text, is already an... |
Forum: C# Apr 4th, 2009 |
| Replies: 38 Views: 2,039 Looks like you are making progress.
You can create a single event handler for the label object to do this, however you could just as easily tag the event into the Drag Drop onto the label.
If... |
Forum: C# Apr 4th, 2009 |
| Replies: 38 Views: 2,039 The container should be the table (panel) not "this".
So instead of creating the labels and adding them to this
this.Controls.Add(lbl);
use
panel1.Controls.Add(lbl);
// Jerry |
Forum: C# Apr 3rd, 2009 |
| Replies: 38 Views: 2,039 Which "table" component are you using ?
Is this a DataGridView ? ListBox ? or something else ?
// Jerry |
Forum: C# Apr 3rd, 2009 |
| Replies: 38 Views: 2,039 The Label was purely to help you experience and play with Drag & Drop (concept stuff).
Not being a Sudoko player myself, I am not all that familiar with the game board.
If I were building it, I... |
Forum: C# Apr 2nd, 2009 |
| Replies: 38 Views: 2,039 Good, I am glad you have decided not to cheat.
On the otherhand, reviewing someones code is the way most everyone learns.
Okay, as for the buttons, I assume you are using Visual Studio 2008... |
Forum: C# Apr 2nd, 2009 |
| Replies: 38 Views: 2,039 http://www.codeproject.com/KB/game/sudoku.aspx |
Forum: C# Apr 2nd, 2009 |
| Replies: 38 Views: 2,039 I would imagine that you can even find some example Sudoko (or similar games) code on Code Project or elsewhere on the net. |
Forum: C# Apr 2nd, 2009 |
| Replies: 38 Views: 2,039 I don't think you really need to have an array of buttons for this project.
Instead set the table to allow drop that way it will allow you to use the drag drop events on the table.
Then on the... |