|
Connection string is working fine. I am using access database to create a crystal report in C#
when I run on my machine It is asking for database server
name and logon information. The problem which I understood from this
is that the path is hardcoded in the crystal report and the database
Day by Day Everyone is moving towards graveyard
|
|
|
|
|
Does anyone know how to create a tooltip popup when we point a mouse over a "text" for a period of time. This is normally seen in visual studio. When we point the mouse on a function name or so for a period of time, it will show its declaration in a small tooltip popup window. How can we customize this to show some tooltip information, upon pointing to some of the words for which we want some info. I want to create this as plugin/add-in in Visual Studio .NET so that on pointing to certain words I can get some information about those words. Coding in either VC++/C#(preferrably VC++). I need some help for this urgently...can anyone help me out???
Alan K. George
|
|
|
|
|
I need a method like
g.FillEllipse( pbImage.image , New Rectangle(100, 100, 10, 10))
This method will fill an ellipse with an image in picturebox named pbimage.
Thank you.
|
|
|
|
|
|
yes you r right, i am damn , how i forgotten it :S
Thanks a lot
|
|
|
|
|
Hi guys,
I have got a CD installing a C# project and copying an access database to the path.
The access file however is always read only - is there a way of chaging this at creating the set up project?
If not, has anyone has those same problems how have they tackled them?
Thanks,
|
|
|
|
|
If you mean what i think you mean, then add a folder to your solution in the Solution Explorer, and then access it by typing Application.StartupPath + Foldername
This will not work in debug mode, it will only work when you have actually published your file, so you will want to use some #if commands
|
|
|
|
|
|
When you add the .mdb file to the setup project, the ReadOnly property for the file in the setup project should get set to false.
If that does not work, then, as a previous poster wrote, you will need to write a custom action to set the file's read/write access.
<edit>
If you have not added the .mdb file to the setup project and are literatlly copying it from the CD, then you will need to do the custom action because the copying probably maintains the read-only-ness of the file on the CD.
</edit>
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
-- modified at 13:49 Saturday 28th January, 2006
|
|
|
|
|
Hi,
I have a toolbar with toolbarbuttons on it. Some of the buttons are pictures only, the rest are text only. The problem is that on the text buttons VS leaves a space in the left side and the size of that empty space is exactly the width of the images from imagelist. Does anyone has any idea how could I get rid of that space? Is there any way to disable the imagelist just for a few buttons?
Thank you in advance,
Magda
|
|
|
|
|
If you go into the "Items" property of the toolbar you can change the display properties of each individual item.
there is a "DisplayStyle" property in there which changes the buttons to either "Image", "Text" or both
|
|
|
|
|
Thank you, but it seems I dont have any "Items" property on the toolbar. I am not sure why is that. Is it possible because I use VS.net 2003? And in "Buttons (Collection)" either
|
|
|
|
|
ok I am using VS2005 thats why you dont have the "items" property
|
|
|
|
|
thanks I will install vs.2005 maybe it will look better after all
|
|
|
|
|
Can you still build a comment webpage from XML comments in VS 2005. The 'build comment webpage' is no longer in the tools menu.
Is this hidden somewhere else?
|
|
|
|
|
problem while mapping XML to treeview
Hi.
Iam trying to show any XML file as a tree in winform treeview control.Iam using the following c# code. I need the following xml to be populated in the tree.The XML file has got attributes for many elements.but the attribute for the <Line>(eg: <Line Number="6">
)is not shown in the tree.Can anyone help me out.
private void mnuUpload_Click(object sender, System.EventArgs e)
{
OpenFileDialog openFileDialog1=new OpenFileDialog();
openFileDialog1.ShowDialog();
if(openFileDialog1.FileName!="")
{
file=openFileDialog1.FileName;
PreProcessXML();
lstHeader.Items.Clear();
lstAttribute.Items.Clear();
txtSelection.Text="";
try
{
// SECTION 1. Create a DOM Document and load the XML data into it.
XmlDocument dom = new XmlDocument();
dom.Load(file);
// SECTION 2. Initialize the TreeView control.
trvXML.Nodes.Clear();
trvXML.Nodes.Add(new TreeNode(dom.DocumentElement.Name));
TreeNode tNode = new TreeNode();
tNode = trvXML.Nodes[0];
// SECTION 3. Populate the TreeView with the DOM nodes.
AddNode(dom.DocumentElement, tNode);//
GetNameSpace();
}
catch(XmlException xmlEx)
{
MessageBox.Show(xmlEx.Message,"Bridge",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
catch(Exception ex){}
}
}
private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
{
XmlNode xNode;
TreeNode tNode;
XmlNodeList nodeList;
int i;
// Loop through the XML nodes until the leaf is reached.
// Add the nodes to the TreeView during the looping process.
if (inXmlNode.HasChildNodes)
{
nodeList = inXmlNode.ChildNodes;
for(i = 0; i<=nodeList.Count - 1; i++)
{
xNode = inXmlNode.ChildNodes[i];
inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
tNode = inTreeNode.Nodes[i];
AddNode(xNode, tNode);
}
}
else
{
// Here you need to pull the data from the XmlNode based on the
// type of node, whether attribute values are required, and so forth.
inTreeNode.Text = (inXmlNode.OuterXml).Trim();
}
}
XML file sample
<Line Number="5">
<ItemNumber Type="IN">2064676311</ItemNumber>
<ItemDescription>C297 DECK(R.H)</ItemDescription>
<ItemUnit>PCE</ItemUnit>
<ItemRevision>K0</ItemRevision>
<Colour></Colour>
<NewItem></NewItem>
<SupplierReference></SupplierReference>
<FreeText></FreeText>
<CumulativeQty Ordered="281" Received="381"/>
<LastReceipt Qty="5" DeliveryNote="KTX7562" Date="20051117"/>
<Plant>
<Identifier>KUK</Identifier>
<Location Code="1"/>
</Plant>
<Schedule>
<Qty Commit="10" Freq="Y" Week="200547" Date="20051127" New="1" Old="1"/>
<Qty Commit="1" Freq="W" Week="200548" Date="20051128" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200549" Date="20051205" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200550" Date="20051212" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200551" Date="20051219" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200601" Date="20060102" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200602" Date="20060109" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200603" Date="20060116" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200604" Date="20060123" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200605" Date="20060130" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200606" Date="20060206" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200607" Date="20060213" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200608" Date="20060220" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200609" Date="20060227" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200610" Date="20060306" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200611" Date="20060313" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200612" Date="20060320" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200613" Date="20060327" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200614" Date="20060403" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200615" Date="20060410" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200616" Date="20060417" New="0" Old="0"/>
<Qty Commit="3" Freq="T" Week="200617" Date="20060424" New="0" Old="0"/>
</Schedule>
</Line>
<Line Number="6">
<ItemNumber Type="IN">20646K3530</ItemNumber>
<ItemDescription>PLATE ASSY</ItemDescription>
<ItemUnit>PCE</ItemUnit>
<ItemRevision>00</ItemRevision>
<Colour></Colour>
<NewItem>Yes</NewItem>
<SupplierReference></SupplierReference>
<FreeText></FreeText>
<CumulativeQty Ordered="0" Received="0"/>
<LastReceipt Qty="0" DeliveryNote="" Date=""/>
<Plant>
<Identifier>KUK</Identifier>
<Location Code="1"/>
</Plant>
<Schedule>
<Qty Commit="10" Freq="Y" Week="200547" Date="20051127" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200548" Date="20051128" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200549" Date="20051205" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200550" Date="20051212" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200551" Date="20051219" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200601" Date="20060102" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200602" Date="20060109" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200603" Date="20060116" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200604" Date="20060123" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200605" Date="20060130" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200606" Date="20060206" New="2" Old="2"/>
<Qty Commit="1" Freq="W" Week="200607" Date="20060213" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200608" Date="20060220" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200609" Date="20060227" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200610" Date="20060306" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200611" Date="20060313" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200612" Date="20060320" New="14" Old="14"/>
<Qty Commit="3" Freq="W" Week="200613" Date="20060327" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200614" Date="20060403" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200615" Date="20060410" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200616" Date="20060417" New="11" Old="11"/>
<Qty Commit="3" Freq="T" Week="200617" Date="20060424" New="29" Old="17"/>
</Schedule>
</Line>
<Line Number="7">
<ItemNumber Type="IN">20646K3570</ItemNumber>
<ItemDescription>PLATE ASSY</ItemDescription>
<ItemUnit>PCE</ItemUnit>
<ItemRevision>00</ItemRevision>
<Colour></Colour>
<NewItem>Yes</NewItem>
<SupplierReference></SupplierReference>
<FreeText></FreeText>
<CumulativeQty Ordered="0" Received="0"/>
<LastReceipt Qty="0" DeliveryNote="" Date=""/>
<Plant>
<Identifier>KUK</Identifier>
<Location Code="1"/>
</Plant>
<Schedule>
<Qty Commit="10" Freq="Y" Week="200547" Date="20051127" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200548" Date="20051128" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200549" Date="20051205" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200550" Date="20051212" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200551" Date="20051219" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200601" Date="20060102" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200602" Date="20060109" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200603" Date="20060116" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200604" Date="20060123" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200605" Date="20060130" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200606" Date="20060206" New="2" Old="2"/>
<Qty Commit="1" Freq="W" Week="200607" Date="20060213" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200608" Date="20060220" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200609" Date="20060227" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200610" Date="20060306" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200611" Date="20060313" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200612" Date="20060320" New="14" Old="14"/>
<Qty Commit="3" Freq="W" Week="200613" Date="20060327" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200614" Date="20060403" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200615" Date="20060410" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200616" Date="20060417" New="11" Old="11"/>
<Qty Commit="3" Freq="T" Week="200617" Date="20060424" New="29" Old="17"/>
</Schedule>
</Line>
<Line Number="8">
<ItemNumber Type="IN">2073071171KA</ItemNumber>
<ItemDescription>BRACKET(R.H)</ItemDescription>
<ItemUnit>PCE</ItemUnit>
<ItemRevision>K0</ItemRevision>
<Colour></Colour>
<NewItem></NewItem>
<SupplierReference></SupplierReference>
<FreeText></FreeText>
<CumulativeQty Ordered="320" Received="418"/>
<LastReceipt Qty="2" DeliveryNote="KTX7444A" Date="20051117"/>
<Plant>
<Identifier>KUK</Identifier>
<Location Code="1"/>
</Plant>
<Schedule>
<Qty Commit="10" Freq="Y" Week="200547" Date="20051127" New="2" Old="2"/>
<Qty Commit="1" Freq="W" Week="200548" Date="20051128" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200549" Date="20051205" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200550" Date="20051212" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200551" Date="20051219" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200601" Date="20060102" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200602" Date="20060109" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200603" Date="20060116" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200604" Date="20060123" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200605" Date="20060130" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200606" Date="20060206" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200607" Date="20060213" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200608" Date="20060220" New="0" Old="0"/>
<Qty Commit="1" Freq="W" Week="200609" Date="20060227" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200610" Date="20060306" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200611" Date="20060313" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200612" Date="20060320" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200613" Date="20060327" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200614" Date="20060403" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200615" Date="20060410" New="0" Old="0"/>
<Qty Commit="3" Freq="W" Week="200616" Date="20060417" New="0" Old="0"/>
<Qty Commit="3" Freq="T" Week="200617" Date="20060424" New="0" Old="0"/>
</Schedule>
</Line>
|
|
|
|
|
well th question is: How to hide TextBox cursor (carret), without disabling it?
thanx in advance
|
|
|
|
|
|
A long time ago i found a win32 function called HideCaret[^], you can try to import it. Then when the textbox has received focus (i think that is when it shows the caret, i'm not sure though...) you can call the HideCaret function with the handle of the textbox as the parameter.
Hope this helps!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
using System.Runtime.InteropServices;
...
[DllImport("user32.dll")]
public static extern bool HideCaret(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool ShowCaret(IntPtr hWnd);
public bool HideCaret()
{
return HideCaret(this.Handle);
}
public bool ShowCaret()
{
return ShowCaret(this.Handle);
} Note: As soon as any text is typed (at least in the RichTextBox), the caret is shown again automatically.
|
|
|
|
|
|
Does [DllImport("user32.dll")] mean that the user32.dll has to be present on the user's machine at runtime, or is it just embedding the code into the app during compilation?
|
|
|
|
|
Yes, user32.dll must be present at runtime. However, all Windows systems (that can run the .net framework) have this DLL, so it shouldn't be an issue.
|
|
|
|
|
Well okay, this won't be a problem then, thanks for the answer.
But then again, it disturbs the eye of the .net purist, as he would prefer not to use 32API code. And more, the HideCaret function does not hide the caret sufficiently. One might put the call into the MouseDown handler for the user can click on the TextBox without seeing the caret, but when he types anything, the caret is back again, as you mentioned earlier in this thread. So you need to manipulate the KeyPress handler as well, or maybe you better take the SelectionChanged handler for that. But still, when you maximize, resize or overlay your window, the caret will return once more, and this is more difficult to treat. You end up dealing with a bunch of events, and each time you'll find another bug bringing this damn caret back to view, like Herpes.
So I found another solution of the HideCaret-problem, and it is a quite simple one. The caret is present when the control has focus and never when it has not, no matter whether the HideSelection property is set to true or false. So all you have to do is to take away focus from the control. The command is
this.SelectNextControl(this, true, true, true, true);
For this you need at least a second control on the form, and that one must be visible and must have TabStop set true. If your form has several controls, there is no further problem. If the TextBox (or RichTextBox) is the only control on the form, then you need to add a "bogus" control, for the selection can cycle (by pressing Tab for example). Any control will do the job, might be a button, a label, or even another TextBox (wich you, as a bonus, can use for logging purposes or so). Set the "bogus" control (=control2) to Margin (all 0), Size (0, 0), TabStop (true), Visible (true). Your primary TextBox (=textBox1) you set to TabStop (false), Cursor (Default), Visible (true). Check TabIndex to be different in both controls.
Now, you handle the MouseDown event of the TextBox (here it's a RichTextBox):
private void richTextBox1_MouseDown(object sender, MouseEventArgs e)
{
this.SelectNextControl(this, true, true, true, true);
}
You must also handle the MouseUp event, because otherwise clicking the right mouse button will bring the caret back. (I don't know why this behaviour occurs, it seems that the right mouse button takes effect only when releasing, in opposite to the left button.)
private void richTextBox1_MouseUp(object sender, MouseEventArgs e)
{
this.SelectNextControl(this, true, true, true, true);
}
Instead of the both Mouse events, you may use the Enter event (it's more simple):
private void richTextBox1_Enter(object sender, EventArgs e)
{
this.SelectNextControl(this, true, true, true, true);
}
With this you are done. The TextBox will never get focus anymore, while window functionality like scrolling, resizing etc. still work. In most cases when you want to make disappear the caret, you don't need to write to the TextBox, but only show some (formatted) text, like an info-sheet or so. If you want to write to the TextBox for any reason, you may add a KeyPress handler to your second control:
private void control2_KeyPress(object sender, KeyPressEventArgs e)
{
richTextBox1.Select(richTextBox1.SelectionStart, 0);
richTextBox1.SelectedText = e.KeyChar.ToString();
}
This is quite easy, and if control2 is another textbox, it could perfectly serve as a key logger or something similar.
Well, this posting got a bit long now. Anyway, I hope it will help some guys (and girls) out there, messing around with a never disappearing caret like I did... I think I will write an article even, about a RichText based Help feature, with this as a part of it.
See you.
Kuno
-- modified at 10:26 Monday 13th March, 2006
|
|
|
|
|
Hi,
I would like to write a little program which monitors a specified Service, and if it isn't running, starts it? how is this possible please?
Thanks
|
|
|
|
|