|
As Garth said; furthermore try using normal language, not txtspk, and when you later need to show some code please use PRE tags to achieve best readability.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Luc Pattyn wrote: and when you later need to show some code
Code, code you think he wants to create some code, don't be silly, he wants YOU to create the codz.Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How can i export data from datagridview into excell using vb dot net. i need simple code.
Help please
|
|
|
|
|
|
CheckOut This article.
You use the *.dll and all you have to do is:
MyGenericDataGridView gexp =
new MyGenericDataGricView("XLS",datagridview1, MyExcelExport.Theme.BlueSky,null,null);
|
|
|
|
|
Hi there,
I was wondering if it is possible to take a windows application and load the contents of the main window inside my c# application as either an MDI window or in a child control of some sort. At work we use some old software where each "module" is a seperate exe with its own window and I wanted to build a c# app with tabs or MDI windows or something to make it a bit more usable. We do not have access to the source code and its not managed code for sure. At first glance, it looks impossible, but I was hoping there was some sort of p/invoke or activeX magic out there. Thank you code project!
-- Steven
|
|
|
|
|
You can make it "look" as if an exe is running from your application using the SetParent API. To find out how, visit this CodeProject article
I are Troll
|
|
|
|
|
Thanks, that code did exactly what I needed it to. With a little customization, I got it so anytime an exe from our old software tries to run, it gets loaded in a tab on my program instead. Very cool!
Thank you so much!
-- Steven
|
|
|
|
|
My pleasure
I are Troll
|
|
|
|
|
|
Possible? Sure, but wise? That's another question... You are going to end up with a mish-mash of menu and tool bars (each app will have their own in their own window) and it is not going function like your typical MDI interface at all really.
|
|
|
|
|
private struct modelStruct
{
public string theModel;
public int theModelID;
}
private modelStruct thisModelStruct;
private ArrayList availableModels = new ArrayList();
I add some items to the arraylist. Then I want
cboModel.DataSource = availableModels;
cboModel.DisplayMember = "ModelID";
cboModel.ValueMember = "theModelID";
But I need to do some casting or content exctraction, but where and how? For DisplayMember the combobox shows "ToolHistory.History+modelStruct".
I have tried cboModel.DisplayMember = thisModelStruct.theModel; but it makes no difference.
|
|
|
|
|
AFAIK your data provider must have properties, not fields, of the specified name(s) for data binding to work.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Greetings
I want to build a windows application that can connect to a webserver for user authentication.
for eg
when we install an IM messenger it's jus like a windows form application. But to authenticate a user it connects to a server.
How can I achieve this functionality.
Plz help.
|
|
|
|
|
- Build a service that offers an authentication API, typically by verifying a user's credentials stored in a database.
- Build a client API that communicates with this service.
- Call the client API from your Windows application.
I recommend using WCF to simplify this task. You can host the service in a Windows service, a standalone app (uncommon, but useful for testing) or a web app.
/ravi
|
|
|
|
|
|
|
|
Hello everybody,
(after pressing a button) i would like to show an image (using a picturebox), wait a few seconds and then play a
mp3 sound, but i dont get it to work. To wait a few seconds i use "System.Threading.Thread.Sleep(5000)". The problem is, the image alway appears AFTER the wait time, but i want it to show first, then wait, then play the mp3... i tried to use "WaitOnLoad = true" but it doesnt work, shouldn't it load the image first and the continue to read the next code line ??
Here is the code i've tried, that doesnt work:
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.WaitOnLoad = true;
pictureBox1.Load("image.jpg");
System.Threading.Thread.Sleep(5000);
MessageBox.Show("test"); //just to test, here should be the code to play the mp3
}
(i also tried loading the image with "LoadAsync" and put the code to wait and play the mp3 in the "LoadCompleted" event, but that doesnt work either...)
would be very nice if somebody helps me
|
|
|
|
|
After you've loaded your image, and before the call to Thread.Sleep() you need to call Application.DoEvents() to enable your form to be updated with the image.
pictureBox1.Load("image.jpg");
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(5000);
|
|
|
|
|
thank you a lot for the answer !!!!
it works now
|
|
|
|
|
calling DoEvents() like that is a hack one should avoid. There are two correct ways to solve such problems:
1. use a timer, preferably a System.Windows.Forms.Timer if the delayed action relates to the GUI;
2. use a separate thread (e.g. a BackgroundWorker), this time with proper Control.InvokeRequired/Imvoke (see here[^]).
Both take a little more effort, but will not fail you, as DoEvents() would when your app becomes somewhat more complex.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Luc Pattyn wrote: as DoEvents() would when your app becomes somewhat more complex.
I'm not disputing your statement but do you have anything to back this (your threading articles live in some of my apps), link, white paper etc.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
No, I don't have any backup, except for logic reasoning: DoEvents() runs another message loop, which means the message queue becomes active while probably executing an event handler already, potentially and unexpectedly turning its caller in a re-entered method, which risks all kinds of things, e.g. to upset your object's state, and maybe even to overflow the stack (imagine DoEvents inside a MouseMove handler).
I would avoid DoEvents() as much as possible, as it is very dangerous; and I would typically not need to call it, as I tend to use threads for most everything except actions that will always finish in a few milliseconds.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
[^]
Guess it doesn't hurt to ask everywhere possible.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|