|
Hi @all,
I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!
|
|
|
|
|
If you make your control not scrollable, it won't scroll. I doubt there is a simple way around this, it's doing what you asked it to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It could be possible to modify control styles to get rid of the scroll bar - must be done through interop though (calling into Win32 API) and still have control thinking it is there (by setting scrollbar's visible to false or similar). I don't think it is too easy as I had a lot of hard time fidling around ListView - it has a lot of strange behaviours under .NET (did you know it is owner-drawn under .NET at all times?)
Regards
JP
|
|
|
|
|
[DllImport("user32.dll")]
static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow);
the call...
ShowScrollBar(listView1.Handle, 1, false);
...works!
Sebastian.
|
|
|
|
|
Has anyone created a method to self-destruct a program yet? Screw all the timed licenses and date-diffs, I want my program to just disapear at xxx time and not be recoverable. end of story! done deal!!!
any ideas?
any takers?
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Yeah, that's easy. You need a second program whose sole job is to delete the first. Then put it in the runonce section of the registry, and it will be deleted the next time the user starts their machine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Does anybody know if there is a SNMP simulator in C# out there?
Any help would be appreciated!
Thanks!
|
|
|
|
|
|
I have serialized my bussiness objects to a file and tried to deserialize them
but it took so much time that creating those objects and putting data into them from database is even faster.
Am I missing any thing?I have though that the deserialization process for my objects from a file should be much much faster as I do not have to create the objects?
MY CODE
***********************
public static void SerializeIdentityMapRegistry()
{
System.IO.Stream s = System.IO.File.OpenWrite(@"C:\Documents and Settings\dogat.ILKON\Desktop\imap.dat");
BinaryFormatter b = new BinaryFormatter();
b.Serialize(s, DAL.identityMap.IdentityMapRegistry.getInstance());
s.Close();
}
public static void DeserializeIdentityMapRegistry()
{
System.IO.Stream s = System.IO.File.OpenRead(@"C:\Documents and Settings\dogat.ILKON\Desktop\imap.dat");
BinaryFormatter b = new BinaryFormatter();
DAL.identityMap.IdentityMapRegistry.Instance = (DAL.identityMap.IdentityMapRegistry)b.Deserialize(s);
s.Close();
}
|
|
|
|
|
First of all:
No .Net serialization isn't very fast. Almost ever you will be by far faster if you (as an example) write a binary file yourself. But this surely means you have to do the major work yourself.
To your problem:
Check your DAL.identityMap.IdentityMapRegistry for unneeded references. Keep in mind that every reference this class holds gets also serialized (and those who are referenced by those which are referenced...). It's a very common mistake that just too much gets serialized - so check it carefully.
|
|
|
|
|
|
I'm using the articl of Twain published on the codeproject, but i have alittle problem which is:
the reutrn datatype is IntPtr, which i can't convert to a bitmap.
what can i do?
|
|
|
|
|
Is the IntPtr a GDI bitmap handle? If yes, look at the System.Drawing.Bitmap.FromHbitmap static method.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
I'm trying to use a combo box on a windows form which will change its display on event of changing combo selection. This is the method I wrote:
private void SurveyChooserCombo_SelectedIndexChanged(object sender, EventArgs e)
{
DAL dal = new DAL();
switch (SurveyChooserCombo.SelectedIndex)
{
case 0:
SrNo = 1;
break;
case 1:
SrNo = 2;
break;
case 2:
SrNo = 3;
break;
default:
SrNo = 3;
break;
}
It doesn't do the job.
Please help me find why.
TIA,
sea#
|
|
|
|
|
|
"doesn't do the job" is very vague, what doesn't work in particular?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
SrNo, which is an int represents survey no. Each time I change the item in combo, it is changed.
"doesn't do the job" means SurveyChooserCombo.SelectedIndex seems to be left unchanged.
When I run the application the form doesn't change the display as expected.
Also cannot run it in debug mode, as I get "there is no source code available for current location", when trying to run over method more then once- to make the change in index come true.
sea#
|
|
|
|
|
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method>>)
???
This is done automatically by Visual Designer - simply naming method SurveyChooserCombo_SelectedIndexChanged does not automatically associate it with the control...
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
Hope this helps.
Regards
JP
|
|
|
|
|
Petras J. wrote:
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method="">>)
???
I do have event handler.
Petras J. wrote:
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
it is just an ordinary drop-down list. Nothing complicated.
What else should I do to make it change once selction changed?
TIA,
sea#
|
|
|
|
|
Wrote this code:
private void SurveyChooserCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (SurveyChooserCombo.Text.Equals("Survey1"))
SrNo = 1;
else if (SurveyChooserCombo.Text.Equals("Survey2"))
SrNo = 2;
else if (SurveyChooserCombo.Text.Equals("Survey3"))
SrNo = 3;
else
SrNo = 3;
GetResults (SrNo);
}
stil event is not fired, dsiplay doesnot changed.
|
|
|
|
|
Hello,
How can I update the specific row in the dataset, where the
row["ProjectID"] == someValue1 and row["VersionNumber"] == someValue2.
I don't want to loop through the whole dataset using foreach statement.
So, what would be the notation for such operation?
Thank you
|
|
|
|
|
You could use DataSet.Table.Select to retrieve the row then update it.
DataRow[] rows = ds.tables[0].select("projectID=? and VersionNumber=?, "ASC");
|
|
|
|
|
Thanks,
But how do you access the data to modify in rows?
rows[0] does not work.
|
|
|
|
|
Are you saying that you want to update the same field in every row in your dataset using one statement?
Can't be done. You'll have to loop through the dataset and make the changes you want to each row individually.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|