|
I am pretty sure that is what he meant, but, is C# and Visual C# the same language? I think that's what he was asking and I'm curious as well.
|
|
|
|
|
One of my forms for some reason cannot use the mouse double click event. I know it's that form as another of my forms runs its DoubleClick(object sender, EventArgs e) fine when I double click it.
Here's what I did to my form: I made it double-buffered, set form border style to none, and gave it a background image. I also have several timers running on the form that randomly changes text on some of the controls. Could it be that too many timers (3 to be exact) on the form can nullify its doubleclick? What could be going on?
|
|
|
|
|
Hello
Nothing of what you did seems to make the problem. Are you sure you are clicking on the form itself, and not on a child control. Forgive the stupid question, but if you made your background as a Dock.Fill PictureBox for example, sure clicking it is different than clicking the form itself. Timers may downgrade your form's performance, but never to prevent event firing.
Are you sure that you registered the event, and nothing is unregistering it later using -=??
Are your timers going on very short intervals -eg. less than 5 milliseconds-?
Did you make a breakpoint to see if it's not actually firing, or are you assuming that becaue the code you wrote in the handler doesn't work?
Regards
|
|
|
|
|
Thanks, but it appears to be none of the above. Timer events no less than 200 milliseconds, i wouldn't know what could be unregistering it, The event really wasn't firing. I am also pretty sure I am not clicking on any of the controls on the form. But I forgot to include another thing. Because the form is borderless, i put in the following code taken from codeproject to be able to move the form. Could this be the cause? But it is strange because another form with this code works fine.
private void MyObj_MouseDown(object sender, MouseEventArgs e)
{
canMove = true;
x0=e.X;
y0=e.Y;
}
private void MyObj_MouseUp(object sender, MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
{
canMove = false;
}
}
protected virtual void MyObj_MouseMove(object sender, MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
{
this.Top+=e.Y-y0;
this.Left+=e.X-x0;
}
}
|
|
|
|
|
Umm... Non of the above should make the problem... In your Form_Load event try to register it manually again, and see if it fires then.
Regards
|
|
|
|
|
Hi,
I'm new to C#. Anyone know how can i create a C# dll which can be called by my delphi program?
What I did so far was create a new Class Library project. My codes are as below:
namespace MyTestDll<br />
{<br />
public class MainTest<br />
{<br />
public MainTest()<br />
{ <br />
}<br />
<br />
public void TestCall()<br />
{<br />
MessageBox.Show("Method is called");<br />
} <br />
}<br />
}
It was then compiled as MyTestDll.dll
In Delphi, i tried using the usual LoadLibrary() and GetProcAddress() function to call TestCall function (in MyTestDll.dll), but it didn't work. Anyone can help me? Thanks!
|
|
|
|
|
Hello
.Net code -exe or dll- is not actually machine code as normal non .net compilers would generate. It's rather an IL -Intermediate Language- that is compiled JIT -Just In Time- in excution. So if you don't use Delphi .Net you won't be able to make calls to a managed .Net dll. Well, not directly.
Regards
|
|
|
|
|
I cannot use Delphi .Net as my current program is written in Delphi 7. How do i call it 'indirectly' then?
|
|
|
|
|
One suggestion is to make you C# code another exe program, then communicate between the two programs some way. Example:
1- Make C# a console program and send your parameters as commandline arguments.
2- Make you C# a Windows service or a formless exe file and communicate using sockets for example.
Well, I hope this works! Otherwise you'd have to use C++ rather than C#.
Regards
|
|
|
|
|
This site has a set of Delphi components that help in calling .NET assemblies. I've used them and they worked great: http://www.managed-vcl.com[^].
|
|
|
|
|
Hey all. I am new to Crystal Reports and was wondering of someone could give me a hand involving adding single data fields to a report.
What I mean by this is, I have a DataSet that contains all the fields I want per row, however, I also want a generic field that does not pertain to the row.
For example, I have a DataSet whose Table name is "Person" and contains the entities, Name, Age, Sex, etc... What I want to add to the report, aside from the rows containing Name, Age, and Sex, is a data field at the top that is user-defined. Perhaps I want to put "Goo goo ga ga" at the top of the report. Instead of having to add an entity to the DataSet, can I define a field in the report, place the field on the report somewhere, and edit it via my code?
I hope you understand what I mean.
Thanks!
-Josh
|
|
|
|
|
Figured out how to do this incase anyone is interested.
1) Add a Text object to your report by right-clicking on the report and selecting Insert->Text Object
2) Set the Name of the object in the Properties window
3) Note the Page Header Section the object resides in
4) CrystalDecisions.CrystalReports.Engine.TextObject myObject = (CrystalDecisions.CrystalReports.Engine.TextObject)theReportClassInstance.theSectionNumber.ReportObjects[ "theObjectName" ];
myObject.Text ="whatever i want";
cheers
|
|
|
|
|
hi everyone,
i want to get all the attributes of an element and put them under that element. but i don't know why at some elements their attributes are displayed beside it and i want to get rid of the namespace too. see the code below and tell me what's wrong with it.
private void populateTreeView(XmlNode node2Iterate, TreeNode currNode)
{
XmlNode xNode;
TreeNode tNode;
XmlNodeList nodeList;
TreeNode attrNode = new TreeNode();
if (node2Iterate.HasChildNodes)
{
nodeList = node2Iterate.ChildNodes;
for(int i = 0; i<=nodeList.Count - 1; i++)
{
TreeNode tn;
xNode = node2Iterate.ChildNodes[i];
tn = new TreeNode("<" + xNode.Name + ">");
currNode.Nodes.Add(tn);
tNode = currNode.Nodes[i];
populateTreeView(xNode, tNode);
if(node2Iterate.ChildNodes[i].Attributes != null)
{
foreach(XmlAttribute attr in node2Iterate.ChildNodes[i].Attributes)
{
string attrs = null;
attrs = "<" + attr.Name + "=\"" + attr.Value + "\"" +">";
currNode.Nodes[i].Nodes.Add(attrs);
}
}
}
}
else
{
currNode.Text = (node2Iterate.OuterXml).Trim();
}
}
the output looks like this on a treeView control:
-<ns:element attr1="a" attr2="b" xmlns:ns="http://testing.com">
-<attr1="a">
-<attr2="b">
thanks for any help!
-- modified at 23:41 Monday 2nd October, 2006
|
|
|
|
|
I think the problem is the following line:
currNode.Text = (node2Iterate.OuterXml).Trim(); Use the LocalName property instead of OuterXml .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
thanks alot for your reply, that fixed my problem
|
|
|
|
|
As I using Adobe Flash as a part of my web application UI,
I really want to simulate somekind of bandwidth when I develop Flash and Server on one PC.
For that ,
I would like to write a windows form to throttle and monitor Flash's(or other appliaction's) bandwidth.
But I dont know how to implement this idea using C# just like Webspeed Simulator(http://www.xat.com/wo/index.html)
### Thanks, Nader Elshehabi ###
But in some condition, I publish my project as a stand-alone one(a .exe file) or writing C# windows form chat client.
-- modified at 22:25 Monday 2nd October, 2006
|
|
|
|
|
Hello
You can do something like a bottle-neck for your WebBrowser. Here is my suggestion:
1- Make a windows Form.
2- Inherit a class from WebBrowser class. Lets calld in WebSim.
3- In WebSim, Handle the Navigating event, and get the new URL yourself.
4- Get the document stream, and load the document yourself. Use Thread.Sleep() method to delay loading ebtween requests according to the speed you desire.
5- Display the document, either as the usual way -part by art as loaded- or when it's fully loaded.
NB.
I haven't tested the above suggestion thoroughly, so it might not work. Otherwise you'd have to write your browser from the scratch using HTTP requests.
Regards
|
|
|
|
|
hi
i use VS2005 .
i have a form that has a Panel and many labels,Textboxs Controls .. in runtime, User fill this Textbox and print it, But how to printpreview and rint this form correctly ?? (because many controls in Panel ,The panel scrollbar appear in Printpreviewdialog(in one article in codeproject)).
thanks ..
|
|
|
|
|
Hello
In CodeProject there are two printing articles that I know of capable of doing this.
One of them I wrote[^], and might cause the problem you are talking about. In this case -and until I update it and fix this issue-, you have to print each control alone.
The other is this article[^], which I think solves your problem, but loses the visual styles.
Regards
|
|
|
|
|
|
hi S. Senthil Kumar
i could not access this component from your link ..
http://blogs.msdn.com/brada/archive/2006/09/23/768683.aspx
Please give me another link for download this component.
|
|
|
|
|
This[^] should work fine.
|
|
|
|
|
(first.....finally. For some reason the forum was making me re-verify my email address. Took like 2 hours for the confirmation msg to reach my inbox)
Anyway...I have a personal project going right now where my application links into several different modules that I've already made. The issue I have is that I have a standard way of handling database connectivity. I encapsulate my database connection and my result set into 2 classes: clsDatabase and clsQueryResults. For each of the individual projects, I've included these 2 classes and made the manipulation methods (i.e. open, close, beginTransaction, commit, rollback, ExecuteQuery) internal for security reasons. But now I have multiple definitions of these files located in each of the 3 modules that interface with the same database. I don't want to maintain each of them in their individual contexts. I want to be able to pull the clsDatabase and clsQueryResults out into a distinct component, but I am stuck on maintaining the integrity of the database. Once the classes are removed from the components, they can no longer access the internal methods located in these classes and making them public is not an option. Does anyone have suggestions to solve this issue?
[edit] To Clarify:
I would like clsDatabase to still be exposed to each of my projects, but not to the UI. Currently clsDatabase is maintained inside each of the projects and I would like to pull it out so I don't have to maintain multiple concurrent database connections to the same database inside the same instance of the program that can potentially attempt to manipulate data in the same table. So, I would like to pull clsDatabase and clsQueryResults out of each of the projects, place them in their own logical layer between my projects and ADO.NET and allow the projects to make direct calls to them with the caveat that they cannot be exposed to the UI. Does anyone know of an elegant solution to this issue? (Feel free to completely dispose of my logical design if you can formulate something that would work)
-- modified at 3:53 Tuesday 3rd October, 2006
|
|
|
|
|
Hi everyone,
Actually, I got some problems to achieve the desired result for my application. Three problems which are:
1 - Restricted and access to any form which under the new popup window (For example: when you open the save dialog, you couldn't do anything unless to save your file or cancel the saving operation. I want to do the something to my popup window.
2 - I have MdiParent form and another normal form, the MdiParent form will appear first, then I Initialized the second one but its appeared under the MdiParent form. How can I change the order of forms?
3 - The last one, I want to add a pie chart that analyzes the data inside dataGridView in the same form. How can I do that?
Thanks in advance.
Digital.Hand
|
|
|
|
|
1. You want to make your form modal. You can do this by creating the new form and then calling "ShowDialog()" and that should do the trick.
|
|
|
|