|
You could check out FileSystemWatcher.. I can't remember if it'll tell you if the file's been opened or closed but it does let you know when a file has been changed, created, deleted etc... You can find it inside your ToolBox in Visual Studio
jay
|
|
|
|
|
Good deal. thank you both. I'm trying to make a PDF buttonclick event register in my code, but apparently this is very hard to do... So i decided to make the buttonclick in the PDF open and change a document. Then my C# app will hopefully see it and respond...worth a try any way. Thanks again.
jpc
|
|
|
|
|
According to this thread[^] it is possible if you're using Acrobat (not reader) with a little Java.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I have a simple scene in Direct3D in c#, but i am having trouble getting it to draw objects in the right order:
Image 1
Image 2 (Wrongness)
device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);<br />
device.BeginScene();<br />
device.VertexFormat = CustomVertex.PositionTextured.Format;<br />
<br />
LoadTexturesAndMaterials("TexFloor.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 8, Floor);<br />
<br />
LoadTexturesAndMaterials("TexPillar.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(fb, 0, 0), 4, 0.2f));<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(-fb, 0, 0), 4, 0.2f));<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(0, 0, -fb), 4, 0.2f));<br />
<br />
LoadTexturesAndMaterials("TexCrystal.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 32, Crystal);<br />
<br />
device.EndScene();<br />
device.Present();<br />
Graphics g = this.CreateGraphics();<br />
g.DrawString("HUD Test", this.Font, Brushes.Red, new PointF(20, 20));<br />
this.Invalidate();<br />
|
|
|
|
|
|
Hi guys I am making a custom control/user control.
How make mycontrol.dosomething(); fire an event
and How do I handle event handlers
Thanks
|
|
|
|
|
public class MyControl : Control
{
public event EventHandler DoingSomething;
public void DoSomething()
{
OnDoingSomething(EventArgs.Empty);
}
protected virtual void OnDoingSomething(EventArgs e)
{
EventHandler eh = DoingSomething;
if(eh != null)
eh(this, e);
}
} The event handler for this event can be done in the same way as any other control.
See my Events Made Simple[^] article for more info including custom event args etc.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Hello,
I have an application with datagrid that takes the information from database (bindingsource).
I have a refresh button to refresh the datagrids.
I want to make a button that the user will write which column from the DB he wants to add to the datagrid to see it's data.
How can i add programaticly new column that will be bound to this database?
|
|
|
|
|
Hi
sorry for post in this forum, because i Posted a message in this link[^] about workflow management standards in .net but noBody replied yet, hence i post again in this forum (and give a link for main question) to find out solution, It's very emergency.
Thanks
|
|
|
|
|
hdv212 wrote: It's very emergency
Looking at your profile: With your Silver membership, nearly 600 messages posted and almost 4 years as a member, you really should know better! It might be a good time to google for a flame suit[^].
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi DaveyM69
thanks for reply, but what's flame suit ?
does have relation with workflow ?
|
|
|
|
|
I have multiple instances of a custom control on a form. I created the control. I am able to use the Tab key to tab to the next control in the order but the Shift+Tab key will not tab to the previous control. The Shift+Tab key also causes the tab to the next control. I also have a couple of Buttons on the form. The Shift+Tab key functions correctly when the buttons have the focus. Can someone suggest why the Shift+Tab key will not shift focus to the previous control when my control has focus?
thanks
|
|
|
|
|
I am for the first time attempting to write a usercontrol for distribution. The control has an image window and a datagrid. My problem comes in trying to register the control for use in applications. I have been lost in the MSDN trying to get the code necessary to register this thing for use as a dll which can be drawn on your form like other windows controls. Does anyone have a template or a project similar that could guide me?
Densher
modified on Thursday, May 14, 2009 12:00 PM
|
|
|
|
|
I got a question first; do you want to make your code available for use in the .NET languages, or do you want to make the code available to 'most' languages (including, but not limited to .NET)?
For the first option, registering would be enough (regasm). For the second option you'd need to make an ActiveX control out of it (regsvr32).
I are troll
|
|
|
|
|
Basically, the control would target applications using VS 2005 and up including .Net as the development platform. I simply wish to enable the coder to draw the control on their form and interact as we did with the old OCX.
Densher
|
|
|
|
|
The user can right-click on the toolbox and add a reference to your assembly by selecting the DLL. You can register the assembly using regasm if you want it to show up in the list of possible .NET references.
I are troll
|
|
|
|
|
I believe you have mis-understood or I have mis-stated my need. I actually get the DLL to register with RegAsm. When I try to draw it on a form I get the error 80040154, CLSID not properly registered. Regasm reported completion successfully. From what I have been able to glean from the MSDN, I need some assembly statements for Interop and Enterprise Services and and possibly an interface. I need to know the structure of those code statements. Thanks for your time on this issue.
Densher
|
|
|
|
|
Hi All
I have a project in C# that I need to import C++ dll
In order to import it I’m using
[DllImport("CommunicationManagerDLL.dll")]
private static extern bool WiMAXGetState(ref eNDIS_802_16E_STATE NDIS_802_16E_STATE);
how can I send a pointer to struct to the dll ?
should I use ref?
Thanks
Ronen
|
|
|
|
|
This should work if you're struct is correct.
eNDIS_802_16E_STATE NDIS_802_16E_STATE interopStruct = new eNDIS_802_16E_STATE NDIS_802_16E_STATE();
bool result = WiMAXGetState(ref interopStruct);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
That looks fine for simple structs, holding value types only, except maybe for padding and different semantics (long and char). And it could go terribly wrong when the struct holds reference types or pointers.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Of course, with no info on the struct it's impossible to be absolutly sure!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi all,
I want to create controls dynamicly on a form with the properties comming from a DataTable. (see code below)
The Table contains the infos like "name", "typ", "location", "size", ... of each control to create.
...
adapter.SelectCommand.CommandText = "SELECT * FROM controls WHERE controls_ID = 123";
adapter.SelectCommand.Connection = conn;
adapter.SelectCommand.CommandTimeout = 60;
DS = new DataSet();
adapter.Fill(DS,"Ctrl");
System.Windows.Forms.Control[] X=null;
Table = DS.Tables["Ctrl"];
if(Table.Rows.Count>0)
{
this.SuspendLayout();
for(int i=0; i<Table.Rows.Count; i++)
{
DataRow row = Table.Rows[i];
Type typ = Type.GetType(row["typ"].ToString());
typ X[i] = new typ();
X[i].Text = row["text"].ToString();
X[i].Name = row["name"].ToString();
this.Controls.Add(X[i]);
}
this.ResumeLayout();
}
...
how can I assign or create the right type of control. (see the marked row)
Is there an other way to do that ?
Thank you for your help
frank
|
|
|
|
|
Hi,
there are at least two ways to do it:
1.
for a limited number of types, provide specific code for each type, maybe inside a switch statement; simple but not really elegant.
2.
use reflection, have a look at Activator.CreateInstance()
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi Luc,
tnx for your answer.
Your first way you have mentioned is a way I can follow for that task but, for the future the second solution might be more interesting.
Do you have a link to an example for the second way ?
txn in advance
frank
|
|
|
|