|
Hello
I wish I could help you more, but I must see the whole code and test it.
Good luck, and I hope you make it.
Regards
|
|
|
|
|
maybe you can suggest a Control tutorial...
something else i tried was before i go into the search method, i do a
SearchButton.Enable = false;
however this doesnt work either.
|
|
|
|
|
could i have done something to this form to accidentally make it always listen?
how is your Control solution different from Form.Controls?
i'm not able to add MainMenu items to Form.Controls.
however, there is a this.Capture field. can i use that somehow?
-- modified at 4:41 Monday 17th July, 2006
|
|
|
|
|
Hello
In another post you said:
lushgrass wrote: however this doesnt work either.
What's wrong with it?
lushgrass wrote: how is your Control solution different from Form.Controls?
What do you mean?? Different in what exactly?
lushgrass wrote: i'm not able to add MainMenu items to Form.Controls
What does this have to do with your isuue?
lushgrass wrote: however, there is a this.Capture field. can i use that somehow?
It doesn't matter. Just set the capture of the mouse somewhere.
If you still can't get it to work, try this:
public partial class Form1 : Form
{
private delegate void React();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Thread MyThread = new Thread(new ThreadStart(MySearchMethod));
foreach (Control C in this.Controls)
C.Enabled = false;
MyThread.Start();
}
private void Reactivate()
{
foreach (Control C in this.Controls)
C.Enabled = true;
}
private void MySearchMethod()
{
int temp = 0;
while(temp < long.MaxValue)
temp++;
Invoke(new React(Reactivate));
}
}
I had to reactivate using another method because the code falls directly after the thread start, and it would reactivate everything even if the thread hasn't finished yet -and maybe that was one of your mistakes in the previous approach-.
Also you have to cal the reactivation method by Invoke(), because cross thread access to form controls is denied.
Regards
|
|
|
|
|
I have an application with several controls but one (checkbox)is disable. I want to send a CTL+M to anable the control.
Any help is greatly appreciated
|
|
|
|
|
Catch the KeyDown event and put this :
if(e.Modifiers == Keys.Control && e.KeyCode == Keys.M)
{
}
|
|
|
|
|
Hello,
I have an MS Access database that has the following structure:
# Category #
- CAT_ID
- PARENT_CAT_ID
- TITLE
I need to populate a treeView control from the table recursively.
Can you please tell how can I do that?
Your help would be greatly appreciated.
|
|
|
|
|
Hello
How about this psuedocode:
foreach(DataRow r in MyTable.Rows)
{
if (MyTreeView.Nodes.Find(PARENT_CAT_ID, true).Length == 0)
MyTreeView.Nodes.Add(CAT_ID);
else
{
foreach (TreeNode MyNode in MyTreeView.Nodes.Find(PARENT_CAT_ID, true))
MyNode.Nodes.Add(CAT_ID);
}
}
Regards
|
|
|
|
|
Hi,
how can i possibly display graphics object? i created it from a picturebox and i added something to the picture but i have no idea on how to display it as i could not convert it to image or bitmap object to display. Can anyone help?
Thanks
|
|
|
|
|
Hello
ah_jiang_9 wrote: how can i possibly display graphics object?
There is a Paint event -or a similar event- that you have to handle in your control to draw whatever you want. In it's PaintEventArg.Graphics you can draw your image as you like. Some controls don't fire this event as they draw there own interface. Yet you can inherit from them or customly draw them. This depends on where you want to draw your graphics object
ah_jiang_9 wrote: i created it from a picturebox and i added something to the picture but i have no idea on how to display it
Why? It's as simple as these three lines:
pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); //Make a new image in the box
Graphics g = Graphics.FromImage(pictureBox1.Image); //Make graphics
g.DrawLine(Pens.Black, new Point(5, 5), new Point(30, 30)); //Draw
Regards
|
|
|
|
|
Hello,
I have this project in mind that includes RS-232 input from a two axis accelerometer. I would like to create a graphical representation of the amount of tilt that the accelerometer measures yet have not a clue how to set up the graphics. I have already created the code to read the accelerometer and translate this into an angle. I wanted to display a line within a circle that represents this angle. I know the math required to find the X,Y components of this line yet dont know how to do this in C#. Any insight would be appreciated. Thanks in advance
cwkoehler
-- modified at 22:55 Thursday 6th July, 2006
|
|
|
|
|
Hello
Create a form, in which create a PictureBox. Use a bitmap of your accelerometer -analog of course- with its grading -careful here;)- as the PictureBox.Image
Now Create a graphics object from that image & draw the line like this:
Point BasePoint = new Point(BaseX, BaseY);
Point GradePoint = new Point(X, Y);
pictureBox1.Image = new Bitmap("MyAccImg.bmp");
Graphics g = Graphics.FromImage(picturebox1.Image);
g.DrawLine(Pens.Black, BasePoint, GradePoint);
Regards
|
|
|
|
|
I have a simple WinForms application developed on .net2.0 and VS2005. I am able to publish the application as a ClickOnce SmartClient to a specific directory located on my machine: C:\apps\publish. Now I am trying to publish the same application from command line using msbuild with the following command...
msbuild /t:publish Solution3.sln
The problem is that the application is published to the project bin\Debug directory, not the C:\apps\publish folder. I set the publish, install, and update URL in VS publish settings to 'C:\apps\publish', but it makes no difference, it msbuild still publishes the files to bin\Debug.
Am I missing something? Changing the OutputPath created issues when attempting to install the application for the first time, so I left it alone for now.
Thanks,
Raffi
|
|
|
|
|
I am trying to consume a Java Web Service through C# client. The soap body when I pass as string, the < > get encoded as <, > and that causes problem for the Webservice. Is there a way to prevent it? I tried using XmlElement but the problem is that the XmlElement already has the root element and then I get two root elements in the soap body. If I try to remove the root then it becomes invalid xml as there are two child nodes and the root is missing. Any help is appreciated.
Thanks,
Vishy
|
|
|
|
|
what is the shutdown command in c# ?
erfan
|
|
|
|
|
|
System.Diagnostics.Process.Start(@"C:\WINDOWS\system32\shutdown.exe", "/f /t 00");<br />
|
|
|
|
|
i want to execute media player in my program .
how i can run a specified application from a dialog based program in C#.
erfan
|
|
|
|
|
|
I found this snippet of code from CodeProject
DataSet dsChanges;<br />
dsChanges = ds.GetChanges(DataRowState.Modified);<br />
if(!dsChanges.HasErrors)<br />
{<br />
da.RowUpdating += new SqlRowUpdatingEventHandler(OnRowUpdating);<br />
da.RowUpdated += new SqlRowUpdatedEventHandler(OnRowUpdated);<br />
int res = da.Update(dsChanges);
da.RowUpdating -= new SqlRowUpdatingEventHandler(OnRowUpdating);<br />
da.RowUpdated -= new SqlRowUpdatedEventHandler(OnRowUpdated);<br />
}
From this article:
http://www.codeproject.com/csharp/practicalguidedatagrids3.asp
My question comes from the bolded part. This OnRowUpdated is never declared in this function.
I found another article doing basically the same thing:
public static bool SubmitChanges(ref DataTable tbl, string ConnectionString, string spUpDateName, string spInsertName, string spDeleteName)<br />
{<br />
try<br />
{<br />
SqlDataAdapter adapter1 = new SqlDataAdapter();<br />
if (spUpDateName != "")<br />
{<br />
adapter1.UpdateCommand = DAHandler.CreateUpdateViaSPCommand(spUpDateName, ConnectionString);<br />
}<br />
if (spInsertName != "")<br />
{<br />
adapter1.InsertCommand = DAHandler.CreateInsertViaSPCommand(spInsertName, ConnectionString);<br />
}<br />
if (spDeleteName != "")<br />
{<br />
adapter1.DeleteCommand = DAHandler.CreateDeleteViaSPCommand(spDeleteName, ConnectionString);<br />
}<br />
adapter1.ContinueUpdateOnError = true;<br />
adapter1.Update(tbl);<br />
adapter1.RowUpdated+=new SqlRowUpdatedEventHandler(adapter1_RowUpdated);<br />
<br />
}<br />
catch<br />
{<br />
throw;<br />
<br />
}<br />
return true;<br />
}
Same problem here. Now for the latter one I have the entire class, not just the code snippet and there is no adapter1_rowUpdated.
How do I fix this? What am I missing?
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">leckey wrote:</div>How do I fix this?</blockquote>
Stop trying to develop software by copy/paste. Really, I am not trying to be harsh but if you think that is the way to go you will never stop having the problems I have seen you go through in the past several weeks.
<blockquote class='FQ'><div class='FQA'>leckey wrote:</div>What am I missing? </blockquote>
You are missing how delegates work in .NET. Those bolded parts are handler methods in the class.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hi, i'm experiencing a weird bug with some code in my custom control's collection.
I've used this code before in same project and vs05 didn't complain for hundreds of builds...but when i needed to tinker more with the control in the designer...then something happened :P ... i now get this error everytime i add items to the collection and attempt to save or build the code:
<br />
Code generation for property 'Items' failed. Error was: ''StudioListBoxItemTypeConverter' is unable to convert 'StudioControls.Controls.StudioListBoxItem' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.'<br />
I tried to seperate the collection from the control to narrow down the bug... "simplified" code for the collection alone are here:
http://focusedwolf.googlepages.com/GenericEventCollectionBase.cs
http://focusedwolf.googlepages.com/StudioListBoxItem.cs
http://focusedwolf.googlepages.com/StudioListBoxItemCollection.cs
http://focusedwolf.googlepages.com/StudioListBoxItemTypeConverter.cs
http://focusedwolf.googlepages.com/TestControl.cs
If you want to see the error, dump all that code into a form project and drag the TestControl onto a form...add an item through the items property...and try to save or build.
-- modified at 16:06 Thursday 6th July, 2006
|
|
|
|
|
I have experienced that. Are you trying to call a specific constructor?
I found some noise that referenced a problem with the version resource using the '*' character. I removed that and it helped but only by making the problem inconsistent. I finally got tired of losing my collection and removed the use of the specific constructor.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hmm this is odd... i'm not getting the bug anymore and i didn't do anything except close vs and open it again... zzz owell guess its just one of those things that never makes sense.
|
|
|
|
|
Or because your collection is now empty?
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|