|
If you don't have a proper schema, you're better off using an XmlDocument or XmlDataDocument, and XPath
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hmm, alright...
then I will switch to XPath for reading and use XmlWriter for writing...
thanks
just another thought...
I searched for any trick I could use to keep using XmlReader... maybe something like this...
bool read = false;
do
{
read = false;
if (reader.Name=="Person")
{
person = reader.ReadElementContentAsString();
read = true;
}
..... other stuff comes here...
}
while (read || reader.Read())
but of course I don't want to create a mess when I forget to set the read = true....
doesn't seem to fit so I will use XPath...
|
|
|
|
|
The core issue is that you don't have a defined schema. It would be better if you did.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I understand. Just a question on that topic.
If I have a defined schema, does this mean that those tags have to be in the same order all the time.
I always thought that it is 'correct' to place tags in any order in the file.
|
|
|
|
|
No, a schema defines the order as well.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hmm, alright, probably I am not understanding that so well after all
how exactly would it help me, if I had a schema...
btw. thanks for your time
|
|
|
|
|
It wouldn't, directly, unless you needed to validate the documents coming in. But, it's very uncommon for a program to not care what order the nodes are in, or expect them to differ.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have two objects that I'm drawing to the screen each is drawn in its own graphics context. I set region, clipping region, etc.. appropriately.
My question is this if I want to do a hit test, combine the two regions or whatever how do I/do I have to save the context and restore it and if so how????
I'm real confused???????
Thanks for any help
Mike
Theres light at the end of the tunnel, hope it ain't no train.
|
|
|
|
|
I am new to .net and C# programming and I am writing a POS type of application that prints a receipt to a small receipt printer. I am having some problems understanding how to format my report for this little printer. It will work in a laserjet on a full sheet, but it won't print on the receipt printer. This is making me crazy!!! Anyway if anyone has any ideas I am so in need of help.
Thanks!!!
Christopher J. Thornburg
Senior Systems Analyst
Ideal Card
|
|
|
|
|
hi,
for POS applications , normally APIs are available like OPOS. which provide methods for primitive printing tasks. for direct printing to a printing device using serial cable , u still can use OPOS standard. u will have to use special characters at begining and end of , for instance , a string to print it. in both cases, you will have to build a string that you want to print and send to printer (like a batch printing pattern). i dont think u its going to be like windows standard printing (i.e on A4 printer).
have a look here for more info
http://monroecs.com/posstandards.htm[^]
regards.
|
|
|
|
|
I'm need to have a control at my c# app that enables the user to crop a picture. I was looking for something like the way it is done when you use a scanner at windows XP(WIA).
Will I have to code it myself or is something allready done for that?
Nuno
--You can't make a program without broken egos--
|
|
|
|
|
It's a pretty easy thing to write. Just capture the users click events to draw the crop area, and then create the new bitmap.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I would imagine that you have to redraw a rectangle in between mouse down and up. I would really like to see some working source code for this. Do you know where to find such a thing.
|
|
|
|
|
Yes, you'd handle MouseMove, and call Invalidate, and then draw the rect in your paint method.
Not sure off hand of any samples in C#.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Will this continuously redraw the rectangle between mouse button down and mouse button up.
|
|
|
|
|
Will this continuously redraw the rectangle between mouse button down and mouse button up. I am very interested in this routine as I have many applications for it but have not been able to implement it even though I have spent many days trying.
|
|
|
|
|
umhh...
I want it to have that usual selection rectangle. I will be coding it when I have some free time and then I will post it...maybe in the next two weeks.
Nuno
|
|
|
|
|
Hi
i want to display the time and date over the form when it runs. How can i achieve that.
What should be the suitable code for it. I can do it in console but i am not getting how to do that over Windows application.
Thanks in advance
|
|
|
|
|
What do you mean by "over" the form?
If you want to display the time and update it continously, you can use a Timer control to update the text of the control where you want to display it.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi all
Just a quick question
I have created a datagrid view populated it with data and added a combobox using DataGridViewComboBoxColumn. This all works fine but a user has asked if it would be possible to over right the options for example:
The dropdown would contain strings "One" "two" "three" but the user would like the option of typing "seven" into the cell
Any ideas would be most appreciated as I have hit a wall!!!
Thanks
John
|
|
|
|
|
I have a listbox(default except theat the selectionmode is "multisimple") that I'm populating dynamically through a BindingSource, with the display and value member set to the same column. On loading of the form, I need to set the initial selected value(s) to a previously-stored value. I declare a List<string> called toSelect and fill it with the correct values. My problem is actually taking those values and selecting the correct listbox item(s).
What I currently have is:
foreach (string s in toSelect)
{
if (uxlbSuite.Items.Contains(s))
{
uxlbSuite.SelectedItems.Add(s);
}
}
The problem is that uxlbSuite.Items.Contains(s) always returns false, and the uxlbSuite.SelectedItems.Add(s) doesn't actually do anything if I don't perform the if check. I think I'm accessing the SelectedItems list wrong, but I'm baffled as to the correct way, and advice would be greatly appreciated.
|
|
|
|
|
Hi Drew,
to locate an item by its string value you want FindString() or FindStringExact()
The SelectedItems collection represents an observed state of the listbox, changing it
does not change the listbox state. You want SetSelected().
Luc Pattyn
|
|
|
|
|
Thanks for the response. What I ended up getting working was looping through the items list (which will never be more than a dozen or so), rather than the List<> of items that needed to select. From that, I could parse the correct object from the associated datarow (by casting it as such) and then compare that to the list of approved items.
uxlbSuite.SelectedItems.Clear();
List<object> objectsToAdd = new List<object>();
foreach (object unit in uxlbSuite.Items)
{
System.Data.DataRowView Row = unit as System.Data.DataRowView;
if (Row != null && toSelect.Contains(Row["ID"].ToString()))
{
objectsToAdd.Add(unit);
}
}
foreach (object unit in objectsToAdd)
{
uxlbSuite.SelectedItems.Add(unit);
}
|
|
|
|
|
Hi,
I have a combobox with a dropdownstyle of DropDown. I have my DataSource and DisplayMember set up in the combobox properties like so:
DataSource = bindingSourceFollowUpCodes
DisplayMember = Legend
ValueMember = FollowUpCode
I have tried to set the properties to update correctly but I can't figure out how to do it. I have searched all over for an answer. I can do this properly in code. Could someone see if they can figure out what the correct property setting s would be to do this without code?
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// Get Groups list
CommandGetFollowUpCodes getFollowUpCodes = new CommandGetFollowUpCodes("%");
m_FollowUpCodes = (FollowUpCodeList)m_AppController.ExecuteCommand(getFollowUpCodes);
// Bind controls
bindingSourceFollowUpCodes.DataSource = m_FollowUpCodes;
comboBoxFollowUpCode.SelectedItem = null;
GroupItem itmGroup = (GroupItem)bindingSourceDefault.Current;
foreach (FollowUpCodeItem itmFollowUpCode in m_FollowUpCodes)
{
if (itmGroup.FollowUpCode == itmFollowUpCode.FollowUpCode)
{
comboBoxFollowUpCode.SelectedItem = itmFollowUpCode;
}
}
}
private void comboBoxFollowUpCode_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBoxFollowUpCode.SelectedItem != null)
{
GroupItem itmGroup = (GroupItem)bindingSourceDefault.Current;
FollowUpCodeItem itmFollowUpCode = (FollowUpCodeItem)comboBoxFollowUpCode.SelectedItem;
itmGroup.FollowUpCode = itmFollowUpCode.FollowUpCode;
}
}
Thanks,
Darren
|
|
|
|
|
Darren D wrote: DisplayMember = Legend
ValueMember = FollowUpCode
These are variables that contain the names you want ?
Darren D wrote: what the correct property setting s would be to do this without code?
Why are people so obsessed with codeless 'programming' nowadays ? I don't think you can link combo boxes in the designer so it works this out for itself.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|