|
I want to develop a ActiveX control in c#.Net, that can handle mouse events, like mouse down, enter, leave, drag and drop events. plz guide me, I will be thank you..
|
|
|
|
|
Why do you want to use ActiveX ?
What info did you find on the web ? What further info do you need ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for u r reply, actually I want to draw almost 1 to 2 million rectangles (nodes) on the screen, for this purpose I have checked many controls but they don’t support such ability. Now I have decided to use C# drawing library. For this purpose I need a light weight object that can be drawn to the screen and manage mouse handling as well. I think ActiveX can help me in this regards. Plz guide me or if u knows any batter solution plz let me know. Thanks a lot.
|
|
|
|
|
ActiveX is a worthless layer of complexity. 1-2 million nodes is a lot, you will have to be careful to handle it correctly. How do you expect to display that many nodes ? Will your control be scrollable ?
Just writing a C# control will give you as much power as C# is going to give you, without the hassle of a ( potentially useless ) ActiveX layer.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Actually I want to give a full picture of entire business at one quick look. So I have to draw the entire nodes. And yea, my control will be scrollable. If you have any batter idea to perform such a scenario plz let me know. In my point of view I should go towards the c# library and handle all the mouse events by myself. What you suggest.
Thank you.
|
|
|
|
|
faheem424 wrote: In my point of view I should go towards the c# library and handle all the mouse events by myself. What you suggest.
Thank you.
Yes, that seems reasonable. The only thing that you don't need, is ActiveX.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
code for creating toolbox
|
|
|
|
|
IS this a question ? What do you mean by a toolbox ? What have you done already ? Where are you stuck ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi!
i m developing EMail client in C# asp.net web application using kerio mail server.
I have sent and received emails using SMTP and POP3 dlls.But i dont know how to add new user of particular domain on my server using c#.
Plz reply soon
thanx
|
|
|
|
|
Please stop cross posting.
---
single minded; short sighted; long gone;
|
|
|
|
|
Is it possible to create new Visualization for Windows Media Player (or winamp) using C#?
Do you know of any article or tutorials? Thanks a lot in advance.
|
|
|
|
|
Hi, I'm wondering how I can ensure a cursor(I'm referring to the IBeam cursor) doesn't appear in a textbox. What I want to do is use a textbox to display some message but I dont want any cursors showing up in it.
Thanks
|
|
|
|
|
if the requirement is such that the user need not enter any data in the textbox, then make the enable property of the textbox to false.
Gautham
|
|
|
|
|
The other reply is on track, but better make the control read only (the ReadOnly property). The user will be able to scroll and the text will appear black (instead of gray), but it will not be editable.
|
|
|
|
|
Setting the textbox enable property to false leave is a faded colour making text hard mopre difficult to read. I've used the Read-Only property however I don't want the user to be able to select the text if that's possible.
Thanks
|
|
|
|
|
Hi !
I'm using Visual Studio 2005 Professional Edition and C#.
I have a simple question:
I want to add to my form, which is a scrollable control, a menustrip and
statusstrip.
The problem is that the menustrip is not fixed at top if i scroll down.
A similar problem exists also for the statusstrip. If i open the program it
is only visible if i scroll down.
The program thinks that the menustrip and the statusstrip are in the Client
region, to which i want to draw something.
So, how can I fix them, so that they are not get lost if i scroll the main
form up or down ?
--
Schwammkopf
PS: The AutoScrollMinSize is set to (ClientSize.Width + 50,
ClientSize.Height + 50). Of course, on each OnPaint i update it.
|
|
|
|
|
In your form you should put a ToolStripContainer, with your MenuStrip at the top and your StatusStrip at the bottom. Then you add your scrollable control in the middle/center of this ToolStripContainer.
Internet - the worlds biggest dictionary
|
|
|
|
|
well, the problem is that my main form is a scrollable control. and i can put it in the container.
besides, how is possible to let the container take the size of the main form if someone resize the mainform ?
|
|
|
|
|
I suppose you have to change it then? Instead of creating a scrollable form, you create a scrollable UserControl, which you can put in any container.
Internet - the worlds biggest dictionary
|
|
|
|
|
Hi All,I'm working on a control derived from UserControl class.
By Default UserControl Class have 6 glyphs for Resizing around the canvas rectangle.
X-----X-----X
| |
X X
| |
X-----X-----X
I marked them with an "X" for an immediate reference.
I need to override them for changing the color of the extreme four:
X-----------X
| |
| |
| |
X-----------X
when a selection rectangle include one of them,two,three or all four,It should become red.
(For sure,if someone knows how override color,will be easy to override the shape(a GraphicPath instead of little rectangles maybe....))
But I cannot Find litterally ANYONE who knows how I can access to adorners and behaviorservice
properties of the Adorners/Glyphs of UserControl Class in .NET 2.0.
Please,it's a week I dig around,Help me!
Thanks So Much!
Frank Drebin
|
|
|
|
|
I have XML file embedded in my C# Winforms application.
I need to add data to <pre><ConnectString></ConnectString></pre>
element so it looks like
<pre><ConnectString>database=mydb;server=localhost;user=myuser</ConnectString></pre>
and return it as string. I created the following method.
Which XmlDocument function I should use to add data to ConnectString node ?
<pre>string GetDefaultReport(string connectionString) {
Stream stream = GetType().Assembly.GetManifestResourceStream
("mynamespace.DefaultReport.xml");
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(stream);
// todo: replace <ConnectString></ConnectString>
// with <ConnectString> connectionString value </ConnectString>
return xmlDocument.InnerXml;
}<pre>
xml file looks as follows:
<pre><?xml version='1.0' encoding='utf-8'?>
<Report xmlns='http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition'
xmlns:rd='http://schemas.microsoft.com/SQLServer/reporting/reportdesigner'>
<DataElementStyle>ElementNormal</DataElementStyle>
<RightMargin>0.25in</RightMargin>
<Body>
<ReportItems>
<List Name='list1'>
<DataInstanceName>Row</DataInstanceName>
<NoRows>Selliseid andmeid pole</NoRows>
<Style />
<DataSetName>Data</DataSetName>
<ReportItems>
<Textbox Name='Algus'>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<CanGrow>false</CanGrow>
<Value>=Fields!akuupaev</Value>
<Width>1in</Width>
<Height>14pt</Height>
</Textbox>
<Textbox Name='Lõpp'>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<Left>1.5in</Left>
<Width>1.5in</Width>
<Height>14pt</Height>
<CanGrow>false</CanGrow>
<Value>=Fields!lkuupaev</Value>
</Textbox>
</ReportItems>
</List>
</ReportItems>
<Style />
<Height>0.25in</Height>
<ColumnSpacing>0.25in</ColumnSpacing>
<Columns>1</Columns>
</Body>
<TopMargin>0.5in</TopMargin><DataSources>
<DataSource Name='DS1'>
<ConnectionProperties>
<DataProvider>PostgreSQL</DataProvider>
<ConnectString></ConnectString>
</ConnectionProperties>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name='Data'>
<Query> <DataSourceName>DS1</DataSourceName>
<CommandText>SELECT akuupaev,lkuupaev FROM {1}.kontekst</CommandText>
</Query>
<Fields>
<Field Name='akuupaev'>
<DataField>akuupaev</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name='lkuupaev'>
<DataField>lkuupaev</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<LeftMargin>0.25in</LeftMargin>
<BottomMargin>0.5in</BottomMargin>
<Width>2.5in</Width>
<PageHeader>
<Height>22.8pt</Height>
<ReportItems>
<Textbox Name='lehepealkiri'>
<Height>12pt</Height>
<Width>5in</Width>
<Value>{2}</Value>
<Left>30.9pt</Left>
<Top>5.8pt</Top>
</Textbox>
</ReportItems>
<PrintOnFirstPage >true</PrintOnFirstPage>
<PrintOnLastPage >true</PrintOnLastPage>
</PageHeader>
<PageFooter>
<Height>0pt</Height>
</PageFooter>
</Report>
</pre>
-- modified at 18:56 Monday 12th February, 2007
Andrus
|
|
|
|
|
set the path to the node which you want to update, later then you could give node.innerhtml=node.innnerhtml +"....."
Hope this works!!
Gautham
|
|
|
|
|
Thank you.
I'm new to C# XML. how to set path to node ?
I think I need simething like
Node node=xmlDocument.SelectNode(/DataSource/ConnectionProperties/ConnectString" );
node.InnerHTML = "database=mydb;host=localhost;user=myuser");
but this causes compile error.
Why ?
Andrus
|
|
|
|
|
AndrusM wrote: but this causes compile error.
Why ?
If you get errors or exceptions, it is always a good idea to tell us exactly what they are. Simply saying "it does not work" or "it causes error/exceptions" makes it harder to help.
Anyway, in the given case it is quite obvious:
1. The XmlDocument class provides no SelectNode method. There are only the SelectNodes and SelectSingleNode methods. You have to use the latter.
2. The starting quote for the XPath expression is missing.
3. There is no type called Node . It's XmlNode .
4. The XmlNode class provides no InnerHTML property. There are a InnerText and InnerXml property. You could use both.
After applying the above changes your code should compile, but it won't work because your XPath expression will not select the element you want. The reason is that all elements in your XML file are qualified with the 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition' namespace through the xmlns declaration on the root element. Your XPath expression will match only unqualified elements. To resolve this issue use the overload of the XmlDocument.SelectSingleNode method that takes an XmlNamespaceManager object. The MSDN topic of the method contains an example that shows you how to do this.
Finally, a small hint (not meant to offend you). You should definitely learn to work with the documentation. It extensively documents the classes of the .NET FRamework class library and contains many examples on how to use them. For example, it would have been plain visible why your code cannot compile by taking a look at the documentation of the classes in question (a method or property that is not listed and described there, is very unlikely to exist and therefore its use will cause compile errors). So, first try to solve your problem by looking at the documentation. If you cannot come up with a solution, try the search engine of your choice. If still no solution, come here and feel free to ask. This process seems time-consuming at the beginning, but it helps alot improving your programming skills and with some practise it get faster and faster.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you very much for help.
I created the following procedure but node value is null.
Why SelectSingleNode() does not return value ?
string GetDefaultReport() {
Stream stream = GetType().Assembly.GetManifestResourceStream
("mynamespace.DefaultReport.xml");
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(stream);
XmlNode node = xmlDocument.SelectSingleNode("/DataSource/ConnectionProperties/ConnectString",
new XmlNamespaceManager(xmlDocument.NameTable));
node.InnerText = "host=localhost;user=admin;database=mydb";
return xmlDocument.InnerXml;
}<pre>
I havent found the XmlNamespaceManager() sample in MSDN.
I have C# Express 2005. Its documentation viewer is not usable. After I press F1 key, it takes 1-2 minutes for documentation viewer to open. It takes also a lot of time to search for every topics.
Documentation viewer is incomplete. In many cases is show error that topics is not available offline. Since I don't have permanent internet connection in many times, it is not possible to get help.
I have dial-up connection and for this reason I have turned images off in IE.
Unfortunately this causes documentation viewer not to dispaly images and corresponding help texts. I must press two (!) times to collapse/expand button to get text readable.
Sime time ago Microsoft offers to download MSDN from their website. However, this download is now closed.
Where to download complete .NET + C# documentation for fast offline view ? CHM format is sufficient for me.
<div class="ForumSig">Andrus</div>
|
|
|
|