|
That depends on how you're serializing objects. If you're just calling a single method that walks an object graph, then you're not going to get anny progress information back from that method. If you're writing the code to walk the object graph, serializing each node yourself, then you can put some extra code in there to report some kind of progress.
But, if you have no way of knowing when the end of the graph is, you really can't report any percentage of progress completed. So, you're only other option would be to use a non-progressing progress bar. It'll just show something is still happening, but not report real progress.
|
|
|
|
|
Thanx for answer.
that's what I was afraid of... I was hoping there might be at least something saying on what position of the Stream is the serializer currently, that would be more than enough for my needs...
btw I'm using BinaryFormatter.Deserialize (Serialize) and I'm implementing the ISerializable interface (GetObjectData and Constructor) for classes to serialize.
I'll just say that something is happening...
zilo
|
|
|
|
|
|
I use the function bellow to create a DataGridViewComboBoxCell in databound gridview in a datagridviewtextboxcolumn. When I enter the cell I can see the dropdown arrow, but when i click on the arrow nothing happens.
Can anybody help me please
Maris
<br />
private void AddComboBox(int index, string selectedValue, List<string> projects)<br />
{<br />
if (projects == null)<br />
throw new NullReferenceException("Project list vas empty");<br />
DataGridViewComboBoxCell aCell = new DataGridViewComboBoxCell();<br />
foreach (string s in projects)<br />
{<br />
aCell.Items.Add(s);<br />
}<br />
aCell.Value = selectedValue;<br />
aCell.DropDownWidth = 1000;<br />
_dataGridView.Rows[index].Cells[0] = aCell;<br />
}<br />
private void _dataGridView_CellMouseEnter(object sender, DataGridViewCellEventArgs e)<br />
{<br />
if (e.RowIndex >= 5 && e.RowIndex <= 9)<br />
{<br />
List<string> projectList = _domainFacade.GetProjects();<br />
string listValue = projectList[0];<br />
AddComboBox(e.RowIndex, listValue, projectList);<br />
}<br />
}<br />
|
|
|
|
|
|
|
So
your code may have incorrect way.
please check your code is correct.
i think u must add cellcolumn.instead of assign to cell.
because of we want to add our cell column control to datagridview control collections.
|
|
|
|
|
Hello all. I'm trying to allow a user to save a text file and only a text file. My filter is "Text files (*txt)|*txt" This seems to be set up fine but when I save a file, I can save as .doc. This shouldn't happen, at least that's what I thought.
Where am I going wrong?
Lester
http://www.lestersconyers.com
|
|
|
|
|
You're making the assumption that the SaveAs dialog restricts the extension the user can use. Wrong. This only filter the filenames listed in the dialog box. You're code has to make sure the extension is correct, and fix it if it's not, after the user clicks OK and before you open the stream to start writing your data.
|
|
|
|
|
I have used WndProc() override to perform PostMessage(this.listViewEx2.Handle, WM_VSCROLL, e.WParam, IntPtr.Zero);
I managed to bring it to some shape now but came up with some amazingly annoying issues!
In all my issues here are as follows
1. scroll works only by thumb tack
2. mouse scroll doesnt trigger listview2
3. scrolling using the bar and not the thumb tack doesnt scroll the listview2
4. how do i prevent the two events from going into an infinite loop when i paste the code for ListView2_Scroll?
Hoping for an express response!
-
Roger
|
|
|
|
|
Perhaps if you specify what you're trying to do, we can provide you with an alternate, managed way to do it.
|
|
|
|
|
private void listViewEx1_Scroll(object Sender, LifeHouse.ListViewEx.ListViewEx.MyScrollEventArgs e)<br />
{<br />
try<br />
{<br />
Int16 hi = (Int16)((int)e.WParam >> 16);<br />
Int16 lo = (Int16)(int)e.WParam;<br />
IntPtr temp;<br />
if (e.Orientation == ScrollOrientation.VerticalScroll)<br />
{<br />
if (lo == 5)<br />
{<br />
if (SetScrollPos(this.listViewEx2.Handle, SBS_VERT, hi, true) != 0)<br />
{<br />
temp = (IntPtr)(4 + 0x10000 * hi);<br />
PostMessage(this.listViewEx2.Handle, WM_VSCROLL, temp, IntPtr.Zero);<br />
}<br />
}<br />
else<br />
{<br />
PostMessage(this.listViewEx2.Handle, WM_VSCROLL, e.WParam, IntPtr.Zero);<br />
}<br />
}<br />
<br />
if (e.Orientation == ScrollOrientation.HorizontalScroll)<br />
{<br />
if (lo == 5)<br />
{<br />
SetScrollPos(this.listViewEx2.Handle, SBS_HORZ, hi, true);<br />
PostMessage(this.listViewEx2.Handle, WM_HSCROLL, (IntPtr)(4 + 0x10000 * hi), IntPtr.Zero);<br />
}<br />
else<br />
{<br />
PostMessage(this.listViewEx2.Handle, WM_HSCROLL, e.WParam, IntPtr.Zero);<br />
}<br />
}<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.ToString());<br />
}<br />
}
This is my code that is supposed to scroll ListViewEx2 when ListViewEx1 is clicked. I am able to achieve a scroll with the thumbtrack of ListViewEx1 but when i hold and drag the scrollbar there is no change in ListViewEx2's scroll in contents (that is, only the scroll bar moves while the content staying put).
Mouse's wat scroll event could trigger a similar scroll?
How to get both scrolls to sync?
|
|
|
|
|
|
If you want to sync the scrolling of two lists, here might be the right way to get it:
- for each item in the master list, identify the corresponding item in the slave list,
and add a (masterItem, slaveItem) to a Hashtable/Dictionary;
- whenever the master list scrolls, determine the new top master item, look up the
corresponding slave item, and scroll the slave list using ListView.TopItem,
ListBox.TopIndex or a similar property.
When the master list does not offer a scrollChanged event, use a Windows.Forms.Timer to do
the above periodically.
That should be much simpler than manipulating Windows messages, WndProc and the like.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
That's the first way that i went by but that aint what the project requires!
When the user clicks on the scrollbar and scrolls the other listview has to be in sync. that is behave as though the user is clicking on two listviews at once and scrolling.
That is the reason i've been trying to override WndProc()!
Can anyone figure a way?
|
|
|
|
|
can you help me guyz.How to make outset of our software through visual studio while setup deployment.I mean how change the default settings,such as showing color progressbar instead of regular one..like that.
i hope you'll get me
|
|
|
|
|
I don't believe that's possible using the standard Visual Studio setup projects. You'll need a more powerful tool to do this, such as InstallShield.
|
|
|
|
|
I have been googling for an answer on this and I just can't find it.
I have a groupbox that contains several checkboxes.
When I go through a foreach loop, the order in the groupbox.controls seems to have no order, but are in the same order everytime.
foreach(CheckBox s in grpGroup.Controls)<br />
{<br />
if(s.Checked)<br />
{<br />
blReports[intx] = true;<br />
}<br />
intx++;<br />
}<br />
What is the logical order of the groupbox.controls collection? It is not tab order, nor creation order. I just can't figure this out.
Thanx in advance!
Jude
|
|
|
|
|
This is the order in which items are inserted in the Controls collection of group box.
Only point is that you get controls in reverse order, which means if you have controls ctrl1, ctrl2 and ctrl3 added.
You will get ctrl3, ctrl2 and ctrl1 using 'for each' loop.
-Ajay.
-------------------------
www.componentone.com
-------------------------
|
|
|
|
|
Ajay K. Singh wrote: This is the order in which items are inserted in the Controls collection of group box.
My question is what controls the order in which the items are inserted into the Controls collection.
The creation order in the code is cntl1,cntl2,cntl3,cntl4,cntl5,cntl6,cntl7.
The order of the foreach loop is 7,2,4,5,1,3,6.
Thanx for the reply!
Jude
|
|
|
|
|
Hi,
AFAIK the order of the controls is not the declaration order, not the creation order, it is
the order in which they get added to their parents Controls collection, which depends
a lot on your Designer interaction. You can modify the order by (carefully) editing
the designer-generated file (xxx.designer.cs). You can also set a new order by:
-first removing all the controls (i.e. move them from the groupbox to the form itself);
-then add them again, one by one, in the desired order (i.e. move them back from the form
to the groupbox).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
If you want to have a more logical order that you have more control of:
for(int i=0;i<grpgroup.controls.count;i++)>
{
Checkbox s=(CheckBox)grpGroup.Controls(i);
if(s.Checked)
{
blReports[intx] = true;
}
intx++;
}
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[^]
|
|
|
|
|
Thanx for all of the replies! From what I gather it is VS dependent in which order controls are added to the groupbox.controls collection.
I decided to go with a switch based on the control name:
if(s.Checked)<br />
{<br />
switch(s.Name)<br />
{<br />
case "cboDepr":<br />
blReports[0] = true;<br />
break;...
Not very elegant, but gets the job done.
Thanx again!
Jude
|
|
|
|
|
Hi
you can check in mm.designer.cs file for the answer, there one array have ur control sequence.
|
|
|
|
|
Is that some type of 2005 or + thing? I am still using VS2003..I don't program any big projects in VS and have kept the staple w/ .net 1.1.
I got it working with my non-elegant code
Thanx for the reply!
And thank you to all who have replied to this thread for not being an ass!
Jude
|
|
|
|
|