|
I think your best bet is to override to override the OnPaint and add custom code to render the image tiled inside the picturebox.
----
www.digitalGetto.com
|
|
|
|
|
I am writing an application that basically has an sidebar and form_view_panel. This sidebar has X amount of buttons on it which correspond to loading specific forms in the form_view_panel. What I need to do is raise an event to the forms in the form_view_panel to let it know when a form change is about to occur(i.e. a toolbar button was clicked), if it(the form in the form_view_panel) wants to allow this to occur at that specific time then it responds back allowing the changing process to occur ORif it doesnt want to change at that point in time that it responds back not allowing the change to occur. So any suggestions on how to implement this using C# event handling methods. Any help will be greatly appreciated.
Thank You
|
|
|
|
|
If I understand correctly, you wanted to send a button-click event from one form to another.
First, a button-click event has to be first handled by its container form. It cannot be sent to or handled by another form. This is how event model should work.
That said, you still can notify any other forms that something interesting has happened. The simpliest (may not be beast) approach is making a callback into any interested forms from within the event handler and let them to further process the event if necessary.
Hope this helps.
Best,
Jun
|
|
|
|
|
The last thing you said is very interest...this callback seems to me to be at least a path for me to go down. Do you know have or know of any code examples?
|
|
|
|
|
Here is some pseudo code:
private void ButtonHandler(object sender, System.EventArgs e)
{
if(sender == this.buttonAdd)
{
anotherForm.AddCallback( someParameters );
}
else if(sender == this.buttonModify)
{
anotherForm.ModifyCallback( someParameters );
}
else if(sender == this.buttonDelete)
{
anotherForm.DeleteCallback( someParameters );
}
}
Best,
Jun
|
|
|
|
|
See the MVC pattern on Wikipedia.com. The Controller can be used to provide the messaging across different views so that the views remain isolated.
|
|
|
|
|
Hello!
It's not really a c# topic but I managed get my answers from this group before. And I need this for my C# application.
Can u tell me where to set default mail and VOIP client. I want to use mailto: and callto: calls from my application and for now callto: calls my Skype and I want to set other client for testing. Do u know where to set that in winXP?
Thanx
Ante
Ante
|
|
|
|
|
Start menu / settings / Control Panel / Add or Remove Program / Set Program Access and Defaults / Custom
Command and Conquer!
uh....
expand and edit!
|
|
|
|
|
thanx!
but is there any why to set callto: ? Actually I need this one more than mailto: since I'm trying to test integration of VOIP programs into my application
Ante
|
|
|
|
|
Well if you look in the registry HKEY_CLASS_ROOT
you will see there is a top level key name 'http', 'https', 'mailto', etc...
I bet there is one named 'callto'
Now I don't know what's inside. But that's the place to look in.
|
|
|
|
|
Thanx!
I'll try to use it
Ante
|
|
|
|
|
Hi
Im using VS 2005 and C# and the Enterprise Library 2.0. I want to design an application that can't be affected by the Database engine i used (SQL Server, Orcale, My Sql, Postegree) how can i acheive that since MySql and Postegree is not supported in Ado.net as
provider.
Thanks for your help
|
|
|
|
|
Cross posting??? Tisk tisk tisk....
|
|
|
|
|
there are three providers in .NET.
odbc
oledb
sql.
oledb I use mainly for Acces, Oracle and sybase connections. The odbc I used once for a DBase V database. Sql is for the Sql server.
What you probably need to do is find the connection string for either the oledb or odbc providers.
oledb is not possible for older databases (like Dbase V) but is faster then odbc.
Sql is the fastest, but will only work with Sql Server.
Hope this helps.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
|
Hi! Recently I have bumped into a problem which I never have had before.
I've got an object which have a couple of onChange events,
I am doing some clones of this object and I really need to "copy" the events that the original object had into the new ones.
Anyone who can help me
Thanks
//
Daniel
|
|
|
|
|
1. make a subclass and call base.MemberwiseClone()
2. serialize then deserialize (caution, it would be a deep copy)
3. Use reflection to call the protected MemberwiseClone() method (requires full trust)
|
|
|
|
|
Thanks for your answer, I implemented it using MemberwiseClone() easiest right now and I think it will do.
But if for some reason any of you have got a nice way to show ... please feel free to do so.
|
|
|
|
|
I have a compiled DLL by VC6.0, in with:
<br />
<br />
#include "argedit.h"<br />
<br />
#include "allocpool.h"<br />
<br />
<br />
<br />
template <class Node, class Edge><br />
<br />
<br />
class StreamARGLoader: public ARGEdit<br />
<br />
{ public:<br />
<br />
typedef Allocator<Node> NodeAllocator;<br />
<br />
typedef Allocator<Edge> EdgeAllocator;<br />
<br />
<br />
StreamARGLoader(NodeAllocator *nalloc, EdgeAllocator *ealloc, <br />
<br />
istream &in);<br />
<br />
<br />
static void write(ostream &out, ARGraph<Node, Edge> &g);<br />
<br />
static void write(ostream &out, ARGLoader &g);<br />
<br />
<br />
private:<br />
<br />
<br />
enum { MAX_LINE=512 };<br />
<br />
void readLine(istream &in, char *line);<br />
<br />
int readCount(istream &in);<br />
<br />
void readNode(NodeAllocator *alloc, istream &in);<br />
<br />
void readEdge(EdgeAllocator *alloc, istream &in);<br />
<br />
};
instruction file :
<br />
int main()<br />
{
NewAllocator<Point> node_allocator;<br />
NullAllocator<Empty> edge_allocator;<br />
<br />
ifstream in("graph.txt");<br />
<br />
<br />
StreamARGLoader<Point, Empty> loader(&node_allocator, <br />
&edge_allocator, <br />
in);<br />
<br />
ARGraph<Point, Empty> graph(&loader);<br />
<br />
And finally hihi i don't know how to using it in C#, i face problem about NodeAllocator and istream &in
Is this "StreamARGLoader" a void or a function?
[DllImport("GraphMatching270606.dll",
EntryPoint="StreamARGLoader",CharSet=CharSet.Auto)]
public static extern void StreamARGLoader(NodeAllocator *nalloc, EdgeAllocator *ealloc, istream &in);
|
|
|
|
|
STreamArgLoader is a template class. You're gonna have one helluva time trying to expose that to C#. It's basically impossible, AFAIK.
What you *can* do, though, is write a C++/CLI class that does the manipulation of the StreamARGLoader class instance. C++/CLI methods are automatically exposed to all .NET assemblies, including C#, and can still deal with regular native C++ classes including template classes. That's what I would do: write a C++/CLI shim that does whatever your C# code needs to do to the StreamARGLoader.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi
I have SplitContainer with two panels where in one panel there are many controls. During Resize event I would like all controls in the panel be resized too. Is there any way to do that automatically (any property) or should I do it by counting the size of each control depending on size of panel? (for me not a good solution).
Thanks for help
Ela
|
|
|
|
|
|
You could try to do an Anchor left, top, right. However all controls in your panel must be in a single collumn for this to work correctly.
What you may have to do if Anchoring does not help is to subscribe to the Resize event on the panel. Then based on the size of Panel1 or Panel2 (whichever side your controls are in) you set the new sizes of your controls. I found one or two situations where Anchoring just did not do it for all of my controls.
|
|
|
|
|
Thanks for the answers. Anchoring is not a good solution. Controls are not resized. I have to do what I was affraid of. I will have to count the size of cotrols depends on size of panel.
Thanks
Ela
|
|
|
|
|
Hi,
In my Java course as part of my degree we did class relationships based on the UML diagram. I would like to implement this same technique with C#.
If I create a Customer and Order class, how can I implement a class relation in code?
Is this the correct way to go in C#, or how is this technique implemented in C#? If any one has any good articles on this, please let me know.
Regards,
ma se
|
|
|
|