|
I think you mean that reading this line, give you an exception :"CrossThread...."
if this what u mean, u need to invoke the thread :
if(textBox.InvokeRequired)
{
textBox.Invoke(method);
}
|
|
|
|
|
Hello all, hope this is the right board to post on.
I have a tab control on a c# pocket pc application. I am only using two tabs and so there is a plethora of empty space on the tab bar that I would like to utilize. I want to add a label over this space to use for program status updates; however, I cannot get a label control to appear above this area. I have tried to send the tab control to the back while bringing the label to the front, and I have even attempted to add the label to the tab control without success.
Any ideas on how I can accomplish this?
Thanks,
B
|
|
|
|
|
How to record a move of player? I am assuming in AddUser() if username entered is pc then PC image will be added and will start playing with human
I have following piece of code: Please help
int movenum;<br />
<br />
private int MoveNumber<br />
{<br />
get<br />
{<br />
return movenum; <br />
}<br />
set<br />
{<br />
movenum = value;<br />
}<br />
}<br />
<br />
<br />
public void AddUser(int user, string strText, string img)<br />
{<br />
lbls = new Label[] { label2, label4 };<br />
pics = new PictureBox[] { pictureBox1, pictureBox2 };<br />
<br />
user--;<br />
if (strText.Equals(""))<br />
{<br />
lbls[user].Text = "Guest";<br />
}<br />
else<br />
{<br />
lbls[user].Text = strText;<br />
}<br />
if (strText.Equals("pc"))<br />
{<br />
pics[user].SizeMode = PictureBoxSizeMode.StretchImage;<br />
pics[user].Load("C:\\WINDOWS\\system32\\setup.bmp");<br />
}<br />
else<br />
{<br />
pics[user].SizeMode = PictureBoxSizeMode.StretchImage;<br />
pics[user].Load(img);<br />
}<br />
<br />
userLoggedIn++;<br />
}<br />
private void switchPlayers()<br />
{<br />
if (player == 1)<br />
{<br />
player = 2;<br />
}<br />
else<br />
{<br />
player = 1;<br />
}<br />
<br />
checkAll();<br />
}<br />
<br />
private void box1_Click(object sender, EventArgs e)<br />
{<br />
if (userLoggedIn == 2)<br />
{<br />
box1.SizeMode = PictureBoxSizeMode.StretchImage;<br />
box1.Image = pics[player - 1].Image;<br />
box1.Enabled = false;<br />
switchPlayers(); <br />
}<br />
<br />
}<br />
<br />
private void box2_Click(object sender, EventArgs e)<br />
{<br />
if (userLoggedIn == 2)<br />
{<br />
box2.SizeMode = PictureBoxSizeMode.StretchImage;<br />
box2.Image = pics[player-1].Image;<br />
box2.Enabled = false;<br />
switchPlayers();<br />
}<br />
<br />
}<br />
<br />
private void box3_Click(object sender, EventArgs e)<br />
{<br />
if (userLoggedIn == 2)<br />
{<br />
box3.SizeMode = PictureBoxSizeMode.StretchImage;<br />
box3.Image = pics[player - 1].Image;<br />
box3.Enabled = false;<br />
switchPlayers();<br />
}<br />
<br />
}<br />
public bool CompareImages(Image image1,Image image2,Image image3)<br />
{<br />
if(!Object.Equals(image1,image2))<br />
{<br />
return false;<br />
}<br />
if(!Object.Equals(image2,image3))<br />
{<br />
return false;<br />
}<br />
if ((image1 == null) || (image2 == null) || (image3 == null))<br />
{<br />
return false;<br />
}<br />
return true;<br />
<br />
}<br />
<br />
public void checkAll()<br />
{<br />
if (CompareImages(box1.Image, box2.Image, box3.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box4.Image, box5.Image, box6.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box7.Image, box8.Image, box9.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box1.Image, box5.Image, box9.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box3.Image, box5.Image, box7.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box1.Image, box4.Image, box7.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box2.Image, box5.Image, box8.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (CompareImages(box3.Image, box6.Image, box9.Image))<br />
{<br />
DisplayWinner();<br />
<br />
}<br />
else if (box1.Image != null && box2.Image != null && box3.Image != null && box4.Image != null && box5.Image != null<br />
&& box6.Image != null && box7.Image != null && box8.Image != null && box9.Image != null)<br />
{<br />
lblDraw.Visible = true;<br />
lblDraw.Enabled = true;<br />
}<br />
<br />
}
|
|
|
|
|
Hi,
I am developing a windows application for the first time with visual studio C#.
When the user installs the application it must also install directories/files.
How can I add Directories with 'template' files(existing *txt, *.dwg files) to my application?
any suggestions?
greetzzz
|
|
|
|
|
When I click such column header where column contains both positive and negative values, the DataGridView makes sort only for the abs (no-negative) value. So the order is right only when column contains only positive numbers. DataGridView's datasource is DataTable where I have just added DataRows one by one. What should be done to get the sort right?
|
|
|
|
|
have you set the "value type" property of the column?
|
|
|
|
|
Thank you, that was exactly what was missing!
|
|
|
|
|
Hi all !
I need to develop a application where users will drag & drop user controls on the design layout (same like in www.formlogix.com, need to develop similar kind of application). And also if you look at "Ironspeed" (www.ironspeed.com), this application does a gr8 job with out creating a simple application from scratch. Please download trial version and look at it.
The layout will be similar to visual studio 2005, where we need to develop a toolbox, property box, solution explorer. And also i need to load user controls which was developed by another programmers. subsequently user will drag & drop controls from toolbox to a designer layout. Then i need to save that layout into a webpage.
There are certain limitation as i came to know.
1. Controls included as Textbox, Listbox, Dropdownlist, Label, Command button, Radio buttons, check boxes and User Controls (which we need to develop with certain functionality)
2. How can we able to incorporate winforms controls on a webpage, i know this cannot be done in this way either can we able to incorporate webcontrols into a winform application?
3. do we need to build user controls in winform application or in webapplication ?
4. This application intially thought to build in a web application through AJAX concepts but i could not able build architecture later we changed to win application taking a prototype as in www.ironspeed.com.
Guys, please help me building up the architecture as well as concepts to put in, appreciate your help and cooperation.
Regards,
krishna
|
|
|
|
|
Sounds like you are taking very complex project... I just know that it must be way easier to develop that what you want as Windows application than ASP.NET + AJAX (this is answer to 3).
In any case, good starting point would be to see how existing editors work - I found this article && you can take a look at SharpDevelop which is open source IDE for .NET (source code on this link).
If you have more questions - shoot
|
|
|
|
|
Hello Every body,
I am trying to get get result in upto 2 decimal place like 25.87
but i m not able to do so.
If i get result lik dis 123273.83563736 then it should be stored in database like 123273.83 means it should be round off upto 2 decimal digit.
Regards,
Rahul
rahul saini
|
|
|
|
|
|
AOA:
i have gridview control which is getting data from some datasource.i want to replace one column data of gridview with my some other value in c#.
can anybody provide me the code for this.
Thanx
|
|
|
|
|
Handle the data binding event and replace the value as you want
only two letters away from being an asset
|
|
|
|
|
While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means..I have an idea of Interfaces.
|
|
|
|
|
Rahul83 wrote: I have an idea of Interfaces
Then you'd better find out what an interface is.
|
|
|
|
|
Rahul83 wrote: While going through collectios i came across a sentence which says.."An object is called collection if it is able to supply a reference to related object called IEnumerator"..can u please explain me what this sentence actually means
The sentence is incorrect in part.
The sentence would read better as: An object can be called a collection if it is able to supply a reference to a related object that implements IEnumerator .
The object calling itself a collection must also implement the IEnumerable interface. The IEnumerable interface sets up a contract that the object must have a method called GetEnumerator() which returns an object that implements IEnumerator
IEnumerator is used internally with in a foreach loop to get at all the elements in a collection.
This is still not the full story, but it does go some way to explaining what that sentence means.
|
|
|
|
|
Tahnks a lot for clearing my doubt..
|
|
|
|
|
How can i check, if an exe has a digital Signature/certicate like VerySign?
roepet01
|
|
|
|
|
...for VeriSign, you're going to have to pay for their SDK. They do not have a public API ...If you're interested, you might want to start by taking a look at VeriSign products for Developers
Welcome my son...Welcome..to the Machine
|
|
|
|
|
I've more than 24000 records and when i search them, it consume a lot of time and my application suspend for some about 5 to 8 seconds. Is there any way to boots up the access time of records in C# and SQL Server 2000.
As compare to vb6 Dot net is very lazy in record access.
Thanks.
Syed Shahid Hussain
|
|
|
|
|
Do the search on the SQL server with a stored procedure and create appropriate indexes.
|
|
|
|
|
Use asnychronous access.
only two letters away from being an asset
|
|
|
|
|
24000 records should still return quicker than 5 to 8 seconds - check the execution plan of your query in query analyzer.
|
|
|
|
|
Hello All,
I have a rather strange app that I want to keep visible in the taskbar at all times, even when the app is set to visible = false.
Thanks in advance for your time and help.
|
|
|
|
|
you can achieve it by overriding OnVisibleChanged. In overrided method, you can force to minimize whenever set visible to false
protected override void OnVisibleChanged(EventArgs e)
{
if(this.Visible == false)
{
this.Visible = true;
this.WindowState = FormWindowState.Minimized;
}
else
base.OnVisibleChanged(e);
}
|
|
|
|