|
Hi, I need to put a text box and button within a single DataGridView cell, the user should be able to edit the text or click the button which brings out another dialog. But I am not going to use PropertyGrid, use DataGridView only,
use C#
_________________
text |button|
this is a single cell, user can click the text to modify it, or click the button
I've tried to modify the calender picker example in microsoft.com, but somehow didn't work out, the user cannot edit the text... I think the once I added customized control to derived class from DataGridViewTextBoxCell, the DataGridViewTextBoxCell doesn't allow user to interact with it, instead, user interact with the customized control (eg: CalendarEditingControl). Since button doesn't have a edit area by default, so the user cannot click and edit. Any idea to solve this? Or other method to achieve this?
Thanks!
Nathan
|
|
|
|
|
A question of architecture/implementation...
I have a Windows service that periodically contacts a central server with status information and the intent is that it can also make a request for work to perform. I have also created a systray app that can be used to manually contact the central server and will also have the ability to make a request for work. Think SETI@Home...
What is the best way for these to work together? I've seen plenty of samples on how to get a Windows Forms app to communicate with the SCM to start/stop a Windows service, but what I want is a bit deeper than that. I want to know if the service's last request for work resulted in it starting a job, and if so, what is it working on?
I moved all the common code out of both the service and systray app into a central library that they both reference. Should the common library just be maintaining some local status database that either can query? Or can the service do all the work all the time, and the systray simply connect to the service and drive/monitor it?
Any suggestions/tips/thoughts greatly appreciated. Any references to online samples also appreciated...
Cheers,
Carl
...Every time I press the little black button on the black panel, a little black light lights up to let me know I've pressed it...
|
|
|
|
|
I would hook a database onto the server end of the process. As you receive jobs, drop the info for that job into the DB. As you start it update a progress table. when you finish it etc...
When the client wants to know where its job is, query the DB and return its history. The best thing with doing it this way is that when the service restarts after a system failure (power cut etc) it knows where it was and can start up again where it left off.
Not sure about online references i'm afraid
Russ
|
|
|
|
|
Russ,
Thanks for the response...
Yeah, as I was writing my original post, I was starting to consider that rather than having the systray app be capable of driving the service, I should just hav ethe two operate independently, but reference the same core library which does the work. And the important addition is that the core library needs to persist its state in a local database. I'm trying to keep the client pieces very light however, so hopefully I can construct a reasonable XML file that can maintain all local information...
Thanks again...
Cheers,
Carl
|
|
|
|
|
hi friends
I have created a UDP multicast program. And now my doubt is if I change font properties of the message in server and send it, the client should be able to receive the message with same font or color. Its a windows form application.
thanks in advance
Rahul
-- modified at 0:41 Friday 30th March, 2007
|
|
|
|
|
Font and other look-n-feel properties are not the part of message. If you want send those too send as rich text format instead of sending just text.
M.Sendilkumar
|
|
|
|
|
ya same thing .... how to send data in rich text format
|
|
|
|
|
Rahul Babu wrote: how to send data in rich text format
Like everything you send on a socket, it is just a sequence of bytes. You get the RTF string and send it as a series of bytes.
|
|
|
|
|
Yes exactly.
M.Sendilkumar
|
|
|
|
|
Use Rich Text box to type message which you want to send.And use RichTextBox1.rtf,not Text.
M.Sendilkumar
|
|
|
|
|
Hi..
I have completed the back end of my project using C++. Now my code has acquired data in multimaps and maps. Now i want to create a add-in for VS.Net which displays the data using trees and such interfaces.
I prefer C# for creating the add-in since i am comfortable with c# more than VB.Net. Can anyone suggest me the means to access the C++' data structures from my C# code..
How can i merge the codes together.. And more importantly how can i access the data available in my C++' STL data structures..
Thanks in advance for the help.
Regards
Vivek
|
|
|
|
|
I think [DllImport] can help you
|
|
|
|
|
Well.. After exporting my C++ code as a DLL, how can i access the data structures.. More importantly i want to traverse the entire map and multimap to construct my interface..
|
|
|
|
|
Hi,
I'm currently working on a Virtual Desktop Manager for Windows Vista that uses the DWM to allow for real-time previews of each of your desktops (Not the same one as on codeplex).
Anyway, everythings working great, except for window Z-ordering. When I switch to a new desktop, I hide all windows on the current desktop by first setting their opacity to 0 by calling SetLayeredWindowAttributes() via P/Invoke, and then setting the window style to ToolWindow using SetWindowLong() also via P/Invoke. This effectively hides the window from flip3d, alt+tab, and the taskbar.
The problem is this, when I bring the windows back, they are often in a different Z-order than when I hid them. I've tried hiding them in the correct Z-order rather than the order their stored in my container, I've also tried showing them by their Z-order (all Z-orders attained using GetWindow()) but they still seem to end up in random whacky orders.
Is this something that other people have dealt with? And if anyone knows, what actually determines their Z-order when displayed on the screen, does it have anything to do with the order in which I set their opacities back to 255 or the order in which I change them back from ToolWindows to their remembered actual styles?
Thanks in advance, I realize this is sort of a strange topic.
-Mike
|
|
|
|
|
In C#, the Parse method of int32, Double, single will raise an FormatExcepton if the input string is invalid (non-numeric) during conversion. Is there an easy way to check it before just calling the Parse method and then receiving such an exception? I don't wanna write a wrapper and catch such an exception which would be stupid for this kind of conversion.
Thanks.
-- modified at 23:18 Thursday 29th March, 2007
|
|
|
|
|
int.TryParse
double.TryParse
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you.
But those TryParse methods are new in .Net 2; actually I need similar stuff in .Net 1.1 .
|
|
|
|
|
No, they aren't.
double.TryParse() definitely is part of 1.1!
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Just checked: double.TryParse() is available in 1.1, but there is no such version for int32 and Single.
Thanks,
|
|
|
|
|
Hello,
You could use double.TryParse with "NumberStyles.Integer" and then Convert the doubleValue to Integer.
double d;
int yourInt;
if(double.TryParse(YoureString,System.Globalization.NumberStyles.Integer, CultureInfo.CurrentCulture, out d))
{
yourInt = Convert.ToInt32(d);
}
All the best,
Martin
|
|
|
|
|
|
In order to extend the features of my app, I need to have the option of loading custom(user-made) controls at runtime. The control(s) would be in the form of a dll. The name of the dll would be a variable(the user would select the control or dll in an Open File Box).
So what is the necessary code to A) load the dll at runtime... B) link to the dll... C) and of course the actual loading of the control which I already know how to do? Any help would be appreciated.;)
NOTE: Yes, this my app is using C#
|
|
|
|
|
Well, as you might imagine, the only way to do this is to use Reflection, since Reflection is the namespace that knows about assemblies.
So, here's a really simple snippet. Create a windows project and double click to get the Form Load event. Add a using directive for System.Reflection. Here's my code for the form load event.
private void Form1_Load(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
List<Control> loadedCtrls = new List<Control>();
if (dlg.ShowDialog() == DialogResult.OK)
{
Assembly src = Assembly.LoadFile(dlg.FileName);
Type[] types = src.GetExportedTypes();
foreach (Type test in types)
{
if (test.IsClass && !test.IsAbstract && typeof(Control).IsAssignableFrom(test))
{
if (test.GetConstructor(Type.EmptyTypes) != null)
loadedCtrls.Add((Control)src.CreateInstance(test.FullName));
}
}
}
Console.WriteLine(loadedCtrls.Count.ToString());
}
Using this snippet on System.Windows.Forms.dll, I get 57 publically constructable Controls. I think this is pretty much what you're looking for.
|
|
|
|
|
I want to learn how to make games with DirectX or OpenGL.
Question 1: Which is more powerful?
Question 2: Which is easier to learn?
Any help would be appreciated.
Also, if there are any other graphic sdk's out there that are better than these, please tell me!
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|