|
I did a windows forms application to print a queue using linkedlists in visual studio 2005 c++ language.
I want to display the job id,file name & priority in the list box.But i didn't get that output.I'm stuck in that point.I can't go beyond with out completing that point.
Also I want to know how to display above values in a data grid view when i click a button at the run time.I want to know the button click event codings for that task.(data grid view)
I have another button called "PAUSE" in my form.When i click that button i want to stop the printing of data in the list box.I used deletenode function in linkedlist for that task.But it don't works.I want to know the button click event for that button (pause) also.
I am pleased if u can reply me if you know the answers for the above problems
thanx.
|
|
|
|
|
Hi,
1. ListBox
this is what a ListBox shows:
- strings, if that is what you add to its Items collection
- ToString() results of whatever type you add to Items
- whatever you want if you do the painting yourself.
So you must:
(a) either construct a string that holds all the required information and at that to the
Items; you may want to choose a non-proportional font (e.g.Courier New), and
String.PadRight() or String.PadLeft() may help you in simulating a columnar layout
(b) or go for an "owner drawn" DrawMode, and use the relevant events (DrawItem, MeasureItem).
(b) is more complex than (a) !
2. DataGridView
showing the same thing in a DGV may require slightly more code, but the result will
show resizeable and sortable columns all by itself.
I suggest you read the DGV documentation and some CodeProject article on it. You can
and should use the Search facilities (on CodeProject or Google).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi
I want to embed the Windows Media Player to my C# win app
I did it successfully.
and I know that for changing it's skin, have to use of 'IWMPRemoteMediaServices.GetCustomUIMode' method.
but I can not find this method at all.
I do not know how can select a desired skin for my WMP object in my application.
anybody help me ?!
H.R
|
|
|
|
|
You need to add a reference to the Windows Media Player API for this function to work.
Go to Project -> Add Reference..
Then click the COM tab and find Windows Media Player UI in the list, and click OK.
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
thanks Virtual1ty ...
I have done this and I have relation with Windows Media Player
but 'IWMPRemoteMediaServices.GetCustomUIMode' method is not in the list.
bye
H.R
|
|
|
|
|
Then I can't help you, sorry.
I am not an expert on this field.
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
I am trying to get the Combo Box working so that i can get the drop-down boxes available for the database columns to be placed in the DataGridView.
But i am getting the following error when the data displays in the DataGridView
The following exception occurred in the DataGridView:
System.ArgumentException: DataGridViewComboBoxCell value is not valid.
To replace this default dialog please handle the DataError event
Background:
The way i am selecting the 'Column Type' is through the Designer.
So i can choose the DataGridViewTextBoxColumn or DataGridViewComboBoxColumn
The dataGridView is hooked up to a bindingSource and I have my bindingSource wired to a List Object.
There is a dataTime picker control on the form, which is used to pull the data.
When i choose the DataGridViewTextBoxColumn, the data displays perfect.
But when i change the 'Column Type' to DataGridViewComboBoxColumn, running the form gives the error repeatedly and as i click on each error, one row of data displays and so on.
Does anyone have a suggestion?
|
|
|
|
|
This error occured when datagrid column value not match with combobox colloection items.this error can be handle on datagrid dataerror events.
void view_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
if (e.Exception.Message == "DataGridViewComboBoxCell value is not valid.")
{
object value = view.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (!((DataGridViewComboBoxColumn)view.Columns[e.ColumnIndex]).Items.Contains(value))
{
((DataGridViewComboBoxColumn)view.Columns[e.ColumnIndex]).Items.Add(value);
e.ThrowException = false;
}
}
}
Jitender Parnami
|
|
|
|
|
In C#.net You should handle data error event of the datagridview
private void grdGuestServiceDetail_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
if(e.Context== (DataGridViewDataErrorContexts.Formatting) || e.Context==(DataGridViewDataErrorContexts.PreferredSize))
{
e.ThrowException = false;
}
}
and In VB.net
Private Sub DataGridView_DataError(ByVal sender As Object, ByVal e As DataGridViewDataErrorEventArgs)
If (e.Context _
= (DataGridViewDataErrorContexts.Formatting Or DataGridViewDataErrorContexts.PreferredSize)) Then
e.ThrowException = false
End If
|
|
|
|
|
Hello
can someone tell me are there any APIs or something like that available so that I set my own custom theme in place of windows xp default theme.I need to write an application which loads some themes from a folder and when one of the theme is selected from the list it is able to set that theme.
Regards
|
|
|
|
|
You can skin your own apps through controlling the repainting of the form. How to do this is out of the scope of a forum post, though.
"I really like comments where I don't have to answer stupid questions" - stfx
|
|
|
|
|
I have a BindingNavigator that handles a child relation. I would like to programmatically move through all items bound to the navigator, without simulating button clicks on it. How can I do this?
|
|
|
|
|
How can I alter/cancel the default behavior of UP and DOWN keys in the auto-complete feature of the combo-box (in Append mode)?
Yours truly,
MSI
|
|
|
|
|
Not sure but you may have to try and trap those two keys and work with them accordingly.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have two (so far) user controls and a TreeView navigator. The tree view is 'bound' to a TransferDefintion object, and displays key nodes of that object. On selecting top a level node, I display the query editor user control, and if a child node is selected, I display a record editor user control.
What I would like to know, is what is a tidy way of updating the edited object when the user controls are swapped. E.g. the record editor has a reference to a Record object, but that object is not updated real time every time the user adds or deletes a field. At the moment I would prefer to tell the user control when to object its reference record.
If I clear the parent panel's control collection before adding a new user control, is there an event that will fire in the current user control before it is removed?
|
|
|
|
|
I want to build a Windows Form Application to represent the tasks done by a printer. the system should have the following features
1. Add a printing job to the printing queue.
2. Cancel a printing job
3. Pause printing
4. Set the priority of a printing job
5. Print the jobs with high priority
6. View the printing queue, jobs completed and jobs paused
7. Clear the printing queue.
A printing Job should have the following basic information
• Job ID
• Name of the file to be printed
• Status ( Completed / Paused / Cancelled )
• Priority Information
can store any more information as necessary.
required to use an appropriate data structure(s) and methods to implement the above scenario.
can design the interfaces with all the necessary features for each of the tasks mentioned above.
can include any number of interfaces to the system and also welcome to add any more features and functions to the system.
please give an ideea to do this system.
|
|
|
|
|
Have you checked this[^] out?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hello there,
I have a common child form which builds a filter string for SQL query before executing the command.
Problem is this form (Filter Constructer) gets called from several parent forms.
Is there anyway I can find the name of the parent form that called the child form, while I'm in the child form? As this will help me handle different procedures in the child form, according to which parent is calling.
Many thanks in advance for your great support.
Hani
|
|
|
|
|
Mehawitchi wrote: Is there anyway I can find the name of the parent form that called the child form,
The child form shouldn't care what form is calling it. Any information the child form needs should be set in a property of the child form, but the code that created and showed the child form. It's not up to the child for to go looking for it's parent.
|
|
|
|
|
As has been said, this is a poor design, but you can use the Parent property to work out what form created the child form, if you need to.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
I'm busy building a Windows Explorer style GUI, and I have three basic controls, before any other controls, and always present. I have a MenuStrip as a main menu, docked to the top of the form, and below it, anchored all round, a SplitContainer. Now it seems inelegant to have to manually position the top of the SplitContainer to nicely meet the bottom of the MenuStrip. I realise I can do this in code, but it's a designer type poblem, not a coding type problem.
I would have liked if docked controls only took up the remaining space, so that I can dock the menu to the top, and set the docking on the SplitContainer to Fill, and have it fill all empty space around it nicely. Am I missing something here?
|
|
|
|
|
What happened when you set the SplitContainer to Dock.Fill? Docking is also controlled by the z-order of the controls, so you may need to send things to the back a few times to get it layered correctly.
|
|
|
|
|
I see now, it's working properly. Thanks.
|
|
|
|
|
|
Iam using two forms in a windows appln. How can I access the control of the second form from the first form.
Thank you
|
|
|
|