|
Hi, I have a third party control DatePicker, it seems to work well in Internet Explorer but when I use Firefox it doesn't display anymore.
Is there a workaround here?
Thank you.
Gerri
|
|
|
|
|
Compare the Html source of your page generated in IE and Mozilla.
|
|
|
|
|
They're the same. But it just doesn't display in FIrefox
|
|
|
|
|
Hi Guys,
I need to write a C# program which should
1. Connect to SQL Server Database
2. Run a query
3. Publish the query results in a nice html page
4. Send the HTML page as attachment by email.
I'm VB programmer totally new to C#. I would appreicate any sort of help to achive the above task.
Thanks.
FIFA - Go Argentina
|
|
|
|
|
What parts of doing this are you having trouble with?
|
|
|
|
|
I am looking for a sequence of code that will retrieve the current selected text from any active window in the system.
For example if I select a paragraph in a Word document or Excel or IE and I run this code, it will capture the selected text.
Any help or direction will be greatly appreciated.
Thanks
|
|
|
|
|
I've done a tbAdapter.fill(DataSet.datatable);
How do I edit the datatable through code? I need to be able to add new rows to the table and I'm having trouble figuring out how. Anyone have a guide that demonstrates this though code? (IE, no interface for background processes).
-- modified at 19:59 Thursday 29th June, 2006
I dont understand how to use dataSet.DataTable.addTableRow() if anyone cares to explain this to me (if it is what I'm even looking for).
Thanks again.
|
|
|
|
|
Adding a row to the table is really quite simple. You are looking for datatable.NewRow();
To add a new row you would do something like this:
DataRow newrow = datatable.NewRow();
row[0] = "blah blah blah";
row[2] = ...
...
dataTable.Rows.Add(newrow);
Basically it creates a new row based on the columns that you have in the already constructed table.
You can also set values for different columns in the row like:
row["SomeColumn"] = "blah blah blah";
Thats really all there is to it
Hope that helps.
|
|
|
|
|
Thanks! worked like a charm...
|
|
|
|
|
I have a ConstextMenuStrip. It have 3 items that are Test1, Test2, Test3.
But i dont know how to catch event for three items.
Example.When i click on Test1, it raises a message "I love you"
Please help me.
Thanks alot
superdragon
|
|
|
|
|
Assuming you're using vs2005, please follow these steps:
1) Select one item
2) Go to property panel->event tab (that has a lightning icon)
3) Select a click event and double-click on it
4) Go to the source file and fill in the handler function body.
Best,
Jun
|
|
|
|
|
Thanks a lot, now i see how to do with it
superdragon
|
|
|
|
|
Ok. I have an app in C#. It uses a com object in main thread. Then there is a button which calls a method in that com object that takes a long time. So I added a thread (backgroundWorker) which calls that function on that COM object. Trouble is that while the worker thread is working the main still is not responsive! Why is that?!
Please help!
|
|
|
|
|
It will be easier for people to help if you post some relevant code snippets.
Josh
|
|
|
|
|
When you refer to your main thread are you meaning that the GUI is unresponsive? If that's the case then you need to use BeginInvoke from your second thread that calls a method on your main thread that updates the GUI. I am not an expert, but I have implimented it serveral times. I still sometimes have to refer to previous code. Check CP for articles on updating your GUI. This is where I found my information.
www.lovethosetrains.com
|
|
|
|
|
Sounds like you need to do a combination of threading and callback when an invoke is required.
Here's some of what I did to leave my UI reponsive in my first threaded app while katakana and hiragana flashcards were being displayed to the user.
//create a thread and a delegate in my class description
private Thread MyCardDisplayThread = null;
delegate void MyAllPurposeCallBack();
//start the thread in one of my many methods
MyCardDisplayThread = new Thread(new ThreadStart(ShowCharacterList));
MyCardDisplayThread.Start();
//use the delegate to process UI changes
//Note: This method is called inside "ShowCharacterList()" method
private void ShowHiraganaFlashCard()
{
if (this.KanaCardPictureBox.InvokeRequired)
{
//invoke is required so use the delegate to perform the invoke
MyAllPurposeCallBack KanaCardDisplay = new MyAllPurposeCallBack(ShowHiraganaFlashCard);
this.Invoke(KanaCardDisplay);
}
else
{
//invoke is not required or has been achieved and so do what the method
//was designed for in the first place
this.KanaCardPictureBox.Image = new Bitmap(AppPath+"\\"+HiraganaCards[CurrentKanaIndex]);
if (1 == RunningMode)
{
//this isn't visible during Test mode so only do this in flashcard mode
this.RomajiDisplayLabel.Text = null;
}
}
}
For every UI manipulation action that you want to perform while you have a process running on another thread, you have to check for InvokeRequired and then use the callback delegate to perform that invoke if it is required, otherwise do what ever that UI manipulation is intended to do.
Hope this helps!
Mike Poz
|
|
|
|
|
Wait. So I don't get it. You manipulating the UI from the second thread? But my second thread is sitting in a COM call. How can it do anything else? You lost me
|
|
|
|
|
I wrote this as my first line: "Sounds like you need to do a combination of threading and callback when an invoke is required."
I wrote that because you didn't supply code examples to give us the full story. Programming doesn't work like "word math" problems. Post your code. Without it we can really only guess what it is that you're actually trying to do and so can only offer possible solutions.
Mike Poz
|
|
|
|
|
So I dropped a backgroundWorker on my main Form, named bgWorker and added two even handlers:
<br />
private void OnBtnExecute(object sender, DoWorkEventArgs e)<br />
{<br />
bgWorker.RunWorkerAsync();<br />
}<br />
<br />
private void bgWorker_DoWork(object sender, DoWorkEventArgs e)<br />
{<br />
<br />
e.Result = oDCRR.ExecuteEx();<br />
}<br />
<br />
private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)<br />
{<br />
}<br />
|
|
|
|
|
inner wrote: // oDCRR is the COM object that is created in main thread and in this second thread
// does something very long in the ExecuteEx
Okay, so this comment explains the real problem. The main thread is also the UI thread so if you execute a COM process that takes a while to complete, you're litterally blocking the UI thread.
I can't guarantee this will work but you need to take the COM operation of the UI/main thread. I would try something like this as this is similar to what I did on my KanaFlash program:
//in the class declaration
private Thread MyCOMThread = null;
private void OnBtnExecute(object sender, DoWorkEventArgs e)
{
// oDCRR is the COM object that is created in main thread and in this second thread
// does something very long in the ExecuteEx
MyCOMThread = Thread(new ThreadStart(PerformCOMOperation));
MyCOMThread.Start();
}
private void PerformCOMOperation()
{
e.Result = oDCRR.ExecuteEx();
MyCOMThread.Abort();
ProcessResults(whatever you need here...);
}
//create a MyCOMThread complete event results processor here
private void ProcessResults(some param)
{
//process results
}
Hope this helps!
Mike Poz
|
|
|
|
|
Hi,
I am trying to invoke a static method on "a_class" which is derived by "another_class" and the static function I am trying to invoke in "another_class".
The problem is that I am trying to do this by using reflections. And by using reflections on "a_class" I can not see any MethodInfo for any static method declared in "another_class".
I am trying to do something as follows:
//I will be getting a generic collection in this object
object oCollection;
//Getting the type
Type factoryType = BuildManager.GetType("My.NameSpace.Class", true);
//Calling a static function on factoryType
oCollection = factoryType.InvokeMember("GetByFilter",
BindingFlags.NonPublic | BindingFlags.Public |
BindingFlags.Static | BindingFlags.InvokeMethod |
BindingFlags.DeclaredOnly | BindingFlags.FlattenHierarchy,
null, null, new object[] { });
Can anybody kindly tell me how can I achive this?
Thanks in advance
Stuck
|
|
|
|
|
I think that getting rid of the DeclaredOnly binding flag should do the trick (assuming that factoryType == typeof(a_class)). DeclaredOnly specifies that the search should not look in base classes for the member.
|
|
|
|
|
Hi Josh,
I really appriciate that you answered my question. I tried by taking off DeclaredOnly BindingFlag but it still didnt work.
Any other suggestion?
By the way, I was able to see the methods declared public in parent class, but I was not able to see the public static method declared in parent class.
Thank you
|
|
|
|
|
You can't.
Static methods only exist in the class where they are declared. They are not inherited.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks alot Guffa for answering!!
seems like I am out of luck
|
|
|
|