|
I rather think it has something to do with this part in the code
void Application_Idle(object sender, EventArgs e)
{
while (AppStillIdle())
game.Tick();
}
private bool AppStillIdle()
{
NativeMethods.Message msg;
return !(NativeMethods.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0));
}
|
|
|
|
|
problem solved....
Instead of using Application.idle to
keep the game updating I use a System.Timers.Timer (async event handler)
to do a tick about every 20ms. (higher refresh rates don't make sense)
So the ScrollBars won't keep me from "ticking" )
maybe a little hack... but it works )
|
|
|
|
|
Same issue here - solved it by replacing the ScrollBar with a TrackBar.
|
|
|
|
|
hi guys
i want to create dynamic textbox according to the excell column values...
for example
i have 2 columns in excell A & B
i want to create textbox for getting values of A & B.
Plz help me is there any idea from urs.
|
|
|
|
|
If you are talking about dynamic it means on runtime.
What you want to do is extract data from excel.
What you have to do is this:
1. create an excel reader (search on articles in codeproject or make your own reader with 'Microsoft.Office.Interop.Excel'
2. create a textbox: TextBox tb = new TextBox(); and put the data in there: tb.Text = ExcelReader.getCellItem(1, "A");
|
|
|
|
|
hi i got the solution of getting dynamic
textbox at runtime
I did it with the help of javascript.
I have created a server side textbox first
and then i found the count of columns from the excell.
according to the count i made it with the help of javascript for loop.
Thanks for your response.
regs
muni
|
|
|
|
|
Please eloberate the question properly..
Are you talking about windows or web application ???
|
|
|
|
|
Hello All,
I want to call one method defined in aspx.cs file like filldropdownlist() and i want to call that method in javascript.
Please let me know how it possible in Javascript.
Thanks
Anish Patel
|
|
|
|
|
No, what you are asking for is not possible. You can't call a server side method from Javascript, and even if you could the server side method doesn't have access to the current page.
You can use AJAX to send a request from a Javascript to the server. The Javascript would then recieve the data sent from the server and put it in the select element.
You can use ASP.NET UpdatePanel controls to define parts of the page to update. It uses AJAX to make call to make a postback of the page, and the page would return the parts of the page that would be updated.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
When i give Listbox.items[i].tostring i get Syetem.Row.DataRowView.
How can i get the text of the item, or the text of the give index number?
Thankyou
YP
|
|
|
|
|
Cast the item back to whatever it was then access that object's properties.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
can u please give a code example
|
|
|
|
|
using System.Windows.Forms;
public partial class Form1 : Form
{
ListBox listBox1;
public Form1()
{
InitializeComponent();
listBox1 = new ListBox();
Controls.Add(listBox1);
FillList();
MyClass secondItem = (MyClass)listBox1.Items[1];
MessageBox.Show(secondItem.MyStringProperty);
}
void FillList()
{
listBox1.Items.AddRange(new object[]{
new MyClass("A"),
new MyClass("B"),
new MyClass("C"),
});
}
}
public class MyClass
{
public MyClass(string myStringProperty)
{
MyStringProperty = myStringProperty;
}
public string MyStringProperty
{
get;
set;
}
public override string ToString()
{
return MyStringProperty;
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
System.Row.DataRowView item = (System.Row.DataRowView)Listbox.items[i];
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
if the ListBox shows the item's information, and item.ToString() does not, then
item.GetItemText() is what you want.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I am reading in a WebBrowser.DocumentText with a timer every x seconds.
The content on the website is being updated with AJAX for new ticket information etc.
When I start my app it works fine, it sees there are x new tickets, the timer runs but the DocumentText contains the initially loaded HTML so the timer never sees the new ticket count. Is there a way to reload the DocumentText etc so it updates when AJAX changes values etc.
So basically
start app initial call sees 4 new tickets... fine that is right
submit a ticket web page updates and now says 5....
timer runs around still sees 4 as if the DocumentText never changes with what I see.
Thanks for the help!
|
|
|
|
|
Why don't you directly request for the web page rather than depending on WebBrowser control? WebClient class has got methods to do this.
|
|
|
|
|
Because I also need the web functionality too. Basically I am interfacing with an extiting support ticket system with a C# application so that I do not have to keep my web browser open constantly.
Thanks for you reply.
|
|
|
|
|
Hi
i want to execute some operations(insert into multiple tables) inside a single transaction via TableAdapter class.
i found this article about how to make tableAdapters transactional : http://blah.winsmarts.com/2006/06/18/the-definitive-tableadapters--transactions-blog-post.aspx[^]
but it's good for a single tableAdapter, wheras i want to insert,update to more than one table, hence i must use multiple TableAdapter for each table and i think above link does not good for this operation.
can anybody help me about this issue ?
Note : i don't want to TransactionScope clas, because it has a low speed.
any idea wood be great appreciated.
Thanks
|
|
|
|
|
hdv212 wrote: i don't want to TransactionScope clas, because it has a low speed.
I am hearing that first time. It worked well for my applications. Do you have any benchmark?
You can use normal SqlTransaction[^]. When all tables are updated, commit the transaction, else rollback. You have to use the same connection instance for doing all the table updations.
|
|
|
|
|
Hi N a v a n e e t h
because my above code make our transaction promote to msdtc, the speed almost decrease and make speed lower, however i extended one of my tableAdapters and add two simple methods like this :
namespace TransactionScopeInsertSample.TestDataSetTableAdapters
{
public partial class t5TableAdapter : System.ComponentModel.Component
{
public SqlConnection OpenConnection()
{
if (this._connection == null) this.InitConnection();
if (this._connection.State != System.Data.ConnectionState.Open)
this._connection.Open();
return this._connection;
}
public void CloseConnection()
{
this._connection.Close();
}
}
}
now, i use this code to make my code transactional (without promote to msdtc) :
using (TransactionScope ts = new TransactionScope())
{
try
{
TestDataSetTableAdapters.t5TableAdapter adapterT5 = new TransactionScopeInsertSample.TestDataSetTableAdapters.t5TableAdapter();
TestDataSetTableAdapters.t6TableAdapter adapterT6 = new TransactionScopeInsertSample.TestDataSetTableAdapters.t6TableAdapter();
adapterT6.Connection = adapterT5.Connection;
adapterT5.OpenConnection();
adapterT5.Insert(int.Parse(this.textBox1.Text));
adapterT6.Insert(int.Parse(this.textBox2.Text));
adapterT5.CloseConnection();
ts.Complete();
MessageBox.Show("Values inserted!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
but my question is that, is this best practice ?
|
|
|
|
|
I am not sure. But it looks OK. What happened when you tried?
|
|
|
|
|
Hi again N a v a n e e t h
I tried and get good result, did u try it too ?
|
|
|
|
|
|
Don't crosspost in a bunch of forums. It's considered very rude.
|
|
|
|