|
Hi,
I'm new to both C# and Windows programming in general but would like to use a USB joystick in my application. I managed this using Delphi and wonder if the same multimedia joystick API can be used in a similar way? It seems that Direct Input is mentioned more frequently in reference to C# although I only need a simple x,y,z value and some buttons presses from a basic joystick.
Can anyone reccomend a simple way to achieve this?
Thanks in advance!
Christian
|
|
|
|
|
Hi
I recommend DirectX DirectInput. I used a class developed by Alex Ward several years ago. First you need to install DirectX SDK. Unfortunately I couldn't find the original article at www.trossenrobotics.com but I can send you the code and SDK installer.
|
|
|
|
|
Hi,
I have a C# window application calling a COM DLL written in VB6. I direct import the DLL using Add reference -> COM.
Now when I change the DLL and recompile it without changing the interface (the public method I use to expose), My C# got an exception that it could not find the interface. I need to derefence and then reference the dll again in my C# project to make it work, why is that? Does it mean I can not distribute dlls in a .NET environment without re-compile the application referencing the dlls?
Thanks
|
|
|
|
|
When you compile it does it change the version or the guids?
|
|
|
|
|
Sorry, my bad, forget to set binary compatible Y,
Thanks,
|
|
|
|
|
I have been reading the "Integrate Help Into Your .NET Apps" how-to and had a question about adding the ? to the form where the Maximize and Minimize boxes are in the title bar. Is there a way to add this without losing those boxes? Could I make my own button on my form that would call the same thing? (if so how would I do it?)
Thanks!
|
|
|
|
|
is it possible to pick more than one date(non continuous) using the calendar control? If so please help me.
|
|
|
|
|
Assuming you are talking about the MonthCalendar control, from a quick glance, doesn't look like it. You could always create a custom control derived from the MonthCalendar control.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
What does the documentation say about that?
|
|
|
|
|
Or something of the sort. that clears out the dataGrid?
|
|
|
|
|
|
Hi have created drawTool application were i am able to draw diagrams using dragable tools and save this digram as text files.i want this application to save this diagram as xml files
Mamphekgo
|
|
|
|
|
mamphekgojakes wrote: i want this application to save this diagram as xml files
Good idea
|
|
|
|
|
Add System.Xml.Serialization attributes to your model. You'll likely have to do it manually since you already have a model built. But you can get a good idea of how to alter your model by producing a sample of what XML the model should produce, and running it through XSD.exe or Skeleton Crew[^]. It's really not difficult at all.
|
|
|
|
|
BoneSoft wrote: by producing a sample of what XML the model should produce
or using a "standard" like.... maybe this[^] one.
|
|
|
|
|
True, but that might be gross overkill... Depending on the project. I had to deal with a 'standard' when I was working for a travel site. It was a joke. HUGE set of schemas that all people we interacted with were 'compliant' with, while all having completely different models. But I've never looked at SVG, I'd assume since their problem domain is more technical they'd have a better standard model.
But also, I was thinking if he's already got a model built and working, he'd probably want to build an XML structure that closely resembles his model.
|
|
|
|
|
I want to pass bool values(true/false) from a datagrid view to radio buttons to another form. Reason being, I am also passing other values from the grid to another form to edit the data. How could i go about passing a true or false value so when my edit form opens the radiobuttons are populated with either a true or false value, based on what value they hold in my datatable?
Thanks
|
|
|
|
|
If you mean how do you pass the values to the new form, you can either do it via the constructor or Properties.
If you mean how do you set the radiobuttons is the .Checked property.
|
|
|
|
|
Its both actually. I want to be able to select True or False two buttons, then pass that true or false value back to my datagrid. Do you have an example of how I can do that or does it all really depend on how data is passed back to the form?
|
|
|
|
|
I have a datagrid on a web page. ASP.net.
One column is a date with an ID of DateReported. After binding the data from a SQL database to it
how do I check if that date if greater than today's date then change the colour of the cell to red. Or do I dothis as each row IS binding?
I've obviously looked on the web and have see 14 different ways to do it, all of them contridictory.
Is it not as simple as....
Foreach
{
If (ConvertToDateTime(myGrid.ColumnName.Equals("DateReported")) > TodaysDate)
{
myGrid.ColumnName.Equals("DateReported").colour.red
}
}
or similar. I'm getting rows, cells, grid items all confused after looking at the solutions offered. Any advice greatful for such a newbie.
|
|
|
|
|
I bind text box below with a string typed datarow where the column i'm going to bind is DateTime. Below id the code:
this.txtDate.DataBindings.Add("Text", m_DataRow, "END_DT", true, DataSourceUpdateMode.OnPropertyChanged, null, "dd/MM/yyyy");
when i click on a chkbox event below fired:
<br />
private void chkbox_CheckedChanged(object sender, EventArgs e)<br />
{<br />
Boolean isChecked = ((CheckBox)sender).Checked;<br />
<br />
if (!isChecked)<br />
{<br />
this.txtDate.Clear()<br />
}<br />
<br />
<br />
<br />
}<br />
Date that show in the textbox is clear. How ever the date time still exist in m_DataRow.END_DT.
I Thought when i set the txtDate.Clear it should also clear the m_DataRow.END_DT some how it won't work. Please help.
|
|
|
|
|
Did you call m_DataRow.AcceptChanges()?
On a side note, if the user unchecks the button, do not clear the text box, just make it read-only and ignore its content. If the user changes his mind, just make it editable again and he won't have to re-enter it.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
Try using txtDate.DataBindings.Remove to remove the databinding, then clear the textbox.
I get all the news I need from the weather report.
|
|
|
|
|
I am learning C# by building an application on two seperate laptops. This fact has lead me to look at how I can specify absolute paths in c#. I have searched the forum and found a number of ways to get the current path an application is running from, ie
public static string current_dir = Application.StartupPath;
However I am using VisualStudio 2005. When i Debug the application this returns: ....\bin\debug.
Thus I cannot use "current_dir" as the basis for any other directories. (Imagee, for example). I assume this should be quite simple... what am I missing?
Thanks,
Jon.
Imagine something witty is written here.
|
|
|
|
|
[d]eljay wrote: hus I cannot use "current_dir" as the basis for any other directories. (Imagee, for example).
If you mean "My Pictures" then you might want to look at Environment.GetFolder() [I think - I don't quite remember off the top of my head]
Anyway, that will allow you to supply an enumerator called SpecialFolders which includes things like the Windows directory, MyDocuments and so on (they are not all called something obvious - read the docs to see what they all mean, or create a quick console application and see what they return). The result of the method call is a string giving the path to the folder you requested.
Also, you shouldn't rely on relative paths for anything outside of your control. Folder names can be renamed or set up differently on each computer. So, if you install some software and create a subdirectory with files in it then that is fine to refer to it relative to the current directory, but not otherwise.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|