|
I'm stuck.
I'm writing a custom drawn ListView and I need to draw the subitems
of each item. So the cleanest way to get the subitem bounds is to send
an LVM_GETSUBITEMRECT message. But it works well only for indexes greater than 0.
This is also noted in MSDN. The big trouble comes when the columns are reordered
by the user. No matter what, LVM_GETSUBITEMRECT for index 0 always returns the bounds,
as if it was the leftmost column. For all other indexes LVM_GETSUBITEMRECT always
works fine in every case. How should I get the proper bounds for subitems at index 0?
|
|
|
|
|
Hello,
I am very much new to C# programming. The problem is I am
facing 'SEHException' using ShowDialog() method of Form Class.
I am using a form as Dialog from a MDIChild Form. I don't know why
it is happenging. But there is no problem if i use 'ShowDialog()'
from a non MDIChild form. How can i use the method from a MDIChild
form ?
sorry for my english.
thanks in advance.
|
|
|
|
|
You don't! MDI Children are not meant to be used a modal dialogs! Use a normal form if your putting up a modal dialog.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A process that I have no control over creates a file that contains multiple XML declarations. Thinking I have to open file and remove all but first declaration and save to be able to read XML.
Do I need to do this, or is there another way to deal with multiple XML declarations in same file?
If I need to open file and manually remove, please help with how I may implement this.
Thank you.
|
|
|
|
|
You can read the file as a regular text file yourself, divide the text into the different xml declarations, and feed one of them or all of them into xml documents using the LoadXml method.
---
b { font-weight: normal; }
|
|
|
|
|
This code doesn't seam to work, it opens both as planned, but the frmCreate opens for 1/4 second or so, help please.
The code:
private void mnuLogin_Click(object sender, System.EventArgs e)<br />
{<br />
Form openform = new frmCreate();<br />
this.Close();<br />
openform.Show();<br />
}
|
|
|
|
|
Of course it does! You closed the form (this) that is the only thing holding a reference to the new form you created. If Form1 creates Form2 and show it, then Form1 closes, Form2 is going to close it since nothing else is holding a reference to Form2.
You can't "transfer" control of your application from form to form to form. You have to have a "parent" form that creates your other forms to keep their references alive. Those "child" forms can have their own "child" forms, and so on down the line. It'll look like a hierarchy when your done.
Startup Form
|
+-------+-------+
| |
Form2 Form3
|
+----+----+
| |
Form4 Form5
In this example, if you Close Form2, Forms4 and 5 are going to vanish too, because Form2 created and was holding the references for 4 and 5. In your code, you did just that. Your (this) form created a new form object called frmCreate, then killed itself, taking the newly created form with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do I HIDE the form or something so frmCreate can be seen?
|
|
|
|
|
try the opacity property
its me =Þ
grim zax
|
|
|
|
|
You don't look through the Intellisense list much, do you? You just said it yourself -> this.Hide()[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I said that as I found it in the list lol.
|
|
|
|
|
What is the best way to:
1. Show a pdf
2. grab a pdf's structure (pages/chapters etc)
3. Grab text only
I've seen many libraries even the Adobe SDK, which claims support for VB C++, I'm just courious if anyone else has looked at working with PDF viewing and had a .net tool to recommend.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
There are some open source C# tools on SourceForge. When I had to do this, I was changing fields in one PDF only, which we generated, so I created a non compressed PDF and changed the text with string replacement. The PDF specification is pretty logical and easy to get, if you need more than that, it may be worth your while to look at it, also.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi
I want to convert one string input in one of my function in c# to System.IO.Stream object but it gives me conversion error in 2nd line of the below function
static myFunc(string strInput)
{
Stream objStream;
objStream=(Stream)strInput;
}
would much appreciate any help
Thank you
Share knowledge to enhance your learning
|
|
|
|
|
You can't expect to convert a type to something else just like that. If you can do with a Reader, you can try the StreamReader class.
Or if you absolutely need a Stream, something like this will work
string obj = "Senthil rocks";
Stream s = new MemoryStream(Encoding.ASCII.GetBytes(obj));
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hey all...im trying to paste something as "enhanced metafile" but i dont know what parameters to set ...anyone know of what they are or where i can find documentation??
WordApp.Selection.PasteSpecial(ref what??????????????????????)
Thanks
FIXED IT:
object Placement=Word.WdOLEPlacement.wdInLine;
object DataType = Word.WdPasteDataType.wdPasteEnhancedMetafile;
WordApp.Selection.PasteSpecial(ref missing,ref missing,ref Placement,ref missing,ref DataType,ref missing,ref missing);
|
|
|
|
|
trying to create child nodes from db, i have 5 entries in the db listed in order as show:
hello1
hello2
hello5
user1
user2
when i create the child node it only shows "hello1", i can get it to change from "hello1" to "hello2" if i change my query, but they still are all the same listing.
here it the code:
treeView1.Nodes.Clear();
dataConnection.Open();
TreeNode dbnode = new TreeNode("Cashier User Names");
TreeNode dbnode1 = new TreeNode();
string dbName = dataConnection.DataSource.ToString();
treeView1.Nodes.Add(dbnode);
dataCommand.Connection = dataConnection;
dataCommand.CommandText = "SELECT id ";
dataCommand.CommandText += "FROM people WHERE access_level = 'Cashier' ORDER BY id DESC";
dataReader = dataCommand.ExecuteReader(CommandBehavior.CloseConnection);
while (dataReader.Read())
{
dbnode1.Tag = dataReader.GetValue(0).ToString();
dbnode1.Text = dataReader.GetString(0);
dbnode.Nodes.Add(dbnode1);
treeView1.ExpandAll();
}
please help as i'm struggling to learn this treeview
there isn't much written info on them that i can find
|
|
|
|
|
You're modifying the same node instance over and over again, no wonder you only see 1 node...
You'll have to call new TreeNode() for every return from your dataReader .
Regards,
mav
|
|
|
|
|
had the new treenode in the wrong spot....
now it works like this:
TreeNode dbnode1 = new TreeNode();
dbnode1.Tag = dataReader.GetValue(0).ToString();
dbnode1.Text = dataReader.GetString(0);
dbnode.Nodes.Add(dbnode1);
treeView1.ExpandAll();
thanks...
|
|
|
|
|
Hi all, give me a bit of advise:
How to send such a kind of struct:
public struct SomeStruct<br />
{<br />
public string strData1;<br />
public long lngData2;<br />
public long lngData3;<br />
}
using .NET Remoting (HTTP prtocol being used)...
or gime, plz, some references where i can find it!
Best regards, FLUID
|
|
|
|
|
Hi!
You just have to mark your struct [Serializable] and then you can use it as parameter type for a remote method.
Regards,
mav
|
|
|
|
|
Yes, its correct, but when i'm trying to declare my struct as [Serializable] i got the following error:
System.Runtime.Serialization.SerializationException: Parse Error, no assembly associated with Xml key
|
|
|
|
|
Without the real struct it'll be hard to help you any further.
Please post some code.
Regards,
mav
|
|
|
|
|
Hi,
I created a DataSet for my webservice application which i can easily use to display data in Web. the data contains list of users and their personal details.
eg.
DataView myview = data.Tables[<tablename>].DefaultView;
it displays all available data in the table.
the question is: is it possible not to display certain data belonging to certain parameter (e.g. emails of certain user)?
e.g. for user 'x & y', his 'email add' should not be displayed.
thanks a lot.
rnv
|
|
|
|
|
The datatable has a select method, which will allow you to run SQL on the data in the table and get the result out. The dataRow has a RowFilter property, which you can use to do the same thing.
Christian Graus - Microsoft MVP - C++
|
|
|
|