|
I just reviewed your other posts just like leckey said
People are here just for helping each other, if you were more polite you could have the answer
here is the article Michael Sync pointed to it and you didn't mention it http://www.codeproject.com/dotnet/twaindotnet.asp
there is another way too, using the Windows Image Acquisition (WIA)
you can search it from Microsoft or just download it from http://hjk.4shared.com
I replied just because you selected Iran as your country in your profile please don't be rude and don't send post like these
|
|
|
|
|
This forum is for programming questions, not for requests for entire projects. However, if you search the site, I believe an article exists for twain in C#
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I have googled for 2 days straight with no success...
Scenario: Load simple xml data into listview control with 2 or more columns.
I have used XmlTextReader and XmlReader with very limited success. I am able to populate the listview but only the first column.
If someone could point me in the right direction, I would greatly appreciate it.
--Steve
|
|
|
|
|
I would suggest investigating how to create a DataTable and populate it with your xml. This will not be an easy task but it's by no means overly difficult either. It will just take a bit of work to accomplish. You will have to create each column in the DataTable and fill it with the appropriate data. Once that's done you can bind the DataTable to the ListView and you should be good to go. There may be a way to cut out the DataTable entirely but you may figure that out by researching what I suggested.
- Arcond
|
|
|
|
|
Go figure: I post my question and then I find my answer.
Answer lies with XmlDocument. See code snippet below.
My xml file (checklist.xml) is really an index used for parsing files of their data based on a starting point, string size, and a description. In turn these are my columns in my listview control as well.
<br />
private void tsbtnRunAudit_Click( object sender, EventArgs e )<br />
{<br />
XmlDocument xdoc = new XmlDocument();<br />
xdoc.Load(@"C:\DEVELOPMENT\Sandbox\VikConvAudit\VikConvAudit\Indexes\checklist.xml");<br />
<br />
<br />
XmlNodeList start = xdoc.GetElementsByTagName("Start");<br />
XmlNodeList size = xdoc.GetElementsByTagName("Size");<br />
XmlNodeList description = xdoc.GetElementsByTagName("Description");<br />
<br />
for(int i = 0; i < start.Count; i++)<br />
{<br />
lvMain.Items.Add(start[i].InnerText);<br />
lvMain.Items[i].SubItems.Add(size[i].InnerText);<br />
lvMain.Items[i].SubItems.Add(description[i].InnerText);<br />
}<br />
<br />
}<br />
<br />
|
|
|
|
|
i want the mod
e.g.
2.6
mod = 6
4.0
mod =0
how can get this in C#
=================
i want function to make this
2.6 =3
2.3 =3
2.1 =3
2.0 =2
is this function allready exist in C#
Palestine
|
|
|
|
|
Did you even try google or msdn?????
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
The modulo operator in C# is % .
However, the modulo operator doesn't do at all what you are asking for. Actually I'm not at all sure what you are actually asking for, but it's not modulo.
TAREQ F ABUZUHRI wrote: 2.6
mod = 6
4.0
mod =0
That looks like the fraction part of a floating point number. You can do that by using the Math.IEEEReminder method:
double num = 2.6;<br />
double fraction = Math.IEEEReminder(num, 1);
TAREQ F ABUZUHRI wrote: i want function to make this
2.6 =3
2.3 =3
2.1 =3
2.0 =2
You have to explain what you mean by that, because it doesn't make any sense at all.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I suggest you look into the Math class; it has what you need and more.
The first can be done with 10.0*(floatValue % 1.0) or 10*IEEEremainder,
but you should not call this mod, it is more like 10 times mod
The second is a simple ceiling.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
TAREQ F ABUZUHRI wrote: =================
Oh... Is that supposed to be some kind of separator, indicating that the text above it is a separate question from the text below it? I replied assuming that you were talking about the same question.
That was far from obvious... Why not just write "and I have another qustion"?
---
single minded; short sighted; long gone;
|
|
|
|
|
For your "mod",
<br />
double x;<br />
your_mod = x - (int)x ;<br />
For the second part, you want Math.Ceiling
|
|
|
|
|
Hi,
Is it possible using Enterprise Library Logger without any changes to default app.config?
I still want to store Logger configuration into the config file, but I need to setup the path to this file in the code
Thanks
Stas
|
|
|
|
|
Honestly I found the log4net API an incredibly easy solution for our clients. Give that a try
|
|
|
|
|
Yeee... I've done it using Enterprise Library. Here is the code:
<br />
FileConfigurationSource fileSource = new FileConfigurationSource(@"ProductApplication.config");<br />
LogWriterFactory factory = new LogWriterFactory(fileSource);<br />
LogWriter writer = factory.Create();<br />
<br />
LogEntry entry = new LogEntry();<br />
entry.Message = "test";<br />
entry.Severity = System.Diagnostics.TraceEventType.Information;<br />
<br />
writer.Write(entry);<br />
|
|
|
|
|
Hi, I'm first time here...
And I'm looking for a litle help...
I use NHibernate...
My applicetion doesn't work properly without some xml files. How can I include xml files at setup witch I created with ClickOnce?
miljan
|
|
|
|
|
If you are worried about you xml mapping files you might need to make sure they are set "Copy to output directory" in the project options. You will need to make sure nhibernate can read the mapping configuration.
Otherwise check my signature for a more robust solution that doesnt involve the xml configs
|
|
|
|
|
I solved my problem. Thank you very much, you help me a lot
miljan
|
|
|
|
|
I have this “search” control which is dropped on a good 2 dozen or so forms in a CE app.
There are possibilities of the control performing 3 different searches… sometime only 1, maybe 2, or even all three.
The user can select which one to start with from a combobox… if they choose the wrong one (no results come back) the control will move on to a different search.
For ascetics, I have a label in front of the textbox that will display whatever was selected in the combobox.
Here comes my problem… the control performs the first search, nothing comes back, it starts a different search… befor that search starts, I change (er, try to change) the value in the combobox and the label to reflect the current search.
The label won’t change until after the search is completed… like 4 methods and 20 some lines of code later:
private void IndexChange(string index)
{
switch (index)
{
case "Item":
lblSearch.Text = "Item:";
cmbBy.SelectedIndex = 0;
break;
case "UPC":
lblSearch.Text = "UPC:";
cmbBy.SelectedIndex = 1;
break;
case "Vendor":
lblSearch.Text = "Vendor:";
cmbBy.SelectedIndex = 2;
break;
}
this.sh.SearchParametersList.Clear();
}
The part that I’m totally not getting is that if I through in a MessageBox beneath the lblSearch.Text lines, it works as I want it to:
private void IndexChange(string index)
{
switch (index)
{
case "Item":
lblSearch.Text = "Item:";
MessageBox.Show("lblSearch should show\"Item\"");
cmbBy.SelectedIndex = 0;
break;
Why does the combobox change when its told to but, the label refuses to listen to me?
|
|
|
|
|
Hi,
everything a Windows app does is event driven, which means there is an input queue,
a lot of messages, and a "message pump" which fetches messages form that queue
and acts on them. Your button click turns into a message, and the message pump
calls your click handler; as long as you are executing inside your click handler
your message pump is waiting for you to finish, before it can process the next
message; that's why the label update seems late.
There are three ways to escape from this:
- showing another modal form (such as MessageBox) launches a new message pump;
of course that is not the right solution, it just explains how it seems to help.
- adding Application.DoEvents() causes the immediate handling of all messages
currently in the queue; this may or may not solve it, it typically does for
simple situations.
- using another thread: this is the general solution for situations where you
want the GUI to be alive while your app is still working on something; it comes
at a cost: you need to set up communications between the main thread and the
new thread, and, the new thread is not allowed to touch your Controls directly;
it needs to use Control.InvokeRequired and Control.Invoke; if you decide to
go this route, make sure to read up on it, and have a look at some examples.
So I suggest you try adding one or two DoEvents() inside your click handler.
And then read up on the different keywords I handed to you.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Fantabulous!
Application.DoEvents() did the trick for me.
I’m not 100% sure I fully grasp why, but I’ve nothing better to do this weekend than wrap my brain around this “message pump” thingy.
Thank you.
|
|
|
|
|
Hello UsielDR,
As Luc Pattyn mentioned in his message there are two ways to solve this issue.
1- Adding Application.DoEvents()
2- Multi-threading "Backgroundworker"
The Application.DoEvents() provides easy solution to simple things such as updating a label with the new text. This is good if you simply expect the user to sit and wait for the search to come back with the result. After all, the Windows Application will be busy dealing with the search job.
My advise is to use the Multi-threading for the search and not to stop the user from using other functions of the windows application. That would be very important when the search turns out to be a lengthy time consuming search. Using multi-threading also allows you to use some fancy stuff like adding a ProgressBar into the StatusBar inorder to show the user that the search is going on and alot more.
Here is a link for a Multi-threading example which I find it very usefully and provide you with lots of help and information.
http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]
I hope this information could provide you with some help,
Have a great day,
khoramdin
-- modified at 14:23 Friday 17th August, 2007
|
|
|
|
|
Hi, my first post here
I'm very new to C# but am familiar with C++. I'm wanting to make a very simple game that will have an XY grid (2d array), and I need it's graphical representation, I also want the "display" to detect where (according to the displayed grid) the mouse was clicked and put a dot on the nearest grid lines intersection (I think the array will be updated first according to the click position, and from there the visual version of it).
I was looking for relevant tutorials, but havn't found anything that resembles to what I'm looking for. Would appriciate a point in the right direction, thanx
|
|
|
|
|
Hi,
here are some basic concepts:
- Windows apps are event driven
- there are several Mouse events, such as MouseDown
- all painting should occur in the Paint handler
if any of these sound unfamiliar, you need to work your way through a book
on C#, then have a look at some of the CodeProject articles, maybe from the
C# games section (I did one on Sokoban).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
In the MouseDown event on the control, form, or whatever get the XY of the cursor.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I develop smart client application,that I need to export Microsoft local report to word format!
But already known that when developing application with win forms we use reportviewer but the reportviewer exports only image,excel and pdf formats!...so I need to export as word..
Heeeeellllp!
|
|
|
|