|
|
You're right. I should have just done this:
Form.Opacity = trackBar.Value / 100;
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
I am having a problem with aborting updates in a DataTable.
I am hooked into the RowChanging Event and, as the docs say, throwing an exception to cause the update to abort.
My problem is that the DataSet does not catch this exception and it bubbles all the way up to Main() which is a bit to late to do anything with.
For this example I have a single form with a ListBox and a TextBox bound to a strongly typed DataSet.
Anyone know how to handle this situation
Thanks
Sttephen.
|
|
|
|
|
could you try butting your listbox on a seperate thread and abort the thread ? or maybe try putting the update in a while statement with a bool.... ie.
it would be a pain too do it with the while statement though cause it would stay in it until the update tells it not too. i would try threads.
while(turnOffUpdateflag==false)
{
;//do my update
}
while(myThread.IsAlive == true)
{
;//do update
}
|
|
|
|
|
<shudder>
There as to be a better way!
I am trying to validate the row when the list changes to a different row. This triggers the RowChanging event from the dataset. If I create the ListBox on another thread, when I abort the thread, surely I would lose the list box as well, and would have to recreate it and restore it to it's current state.
15 minute project has now managed to waste the best part of a day!!
This looked so simple when I read the docs. LOL, should have known better by now!
Stephen.
|
|
|
|
|
i have a encryption program with the encryption method....the recursive file search method..all running on a string... when the user clicks stop..... it cancels the threads ..and the results that were found before the thread stopped are still in the list box... then when the user clicks the search button agian i tell the program too recreated the thread agian and it startes over
any time you abort a thread you have to reintialize it ie
make a private void just for your threads so you can call on then and get them reintialized when ever needed.
i have never used a datagrid before (isnt that what you are using? cant remeber) but this has always worked for listboxes atleast.
private void mylistboxThread()
{
Thread Update = new Thread(new ThreadStart(updatefunctions))
}
private void updateFunctions()
{
//put your update code here.
}
Update.Start();//start thread
Update.Abort();//abort thread
jesse m 
|
|
|
|
|
But you are in control of starting the thread. What I want to do is in response to a users click on the listbox, which will be triggered from an incoming windows message (WM_MOUSE_DOWN or what ever) via the forms message loop that is running on the forms main thread, therefor my thread of execution would never make it onto my thread.
Make sense?
Stephen.
|
|
|
|
|
I'm making a deployment msi in VS.net, and I want to make the registry entry for the app be:
HKEY_CURRENT_USER
Software
[Manufacturer]
[ProductName]
v[Version]
myvariablehere
what happens is, Manufacturer and ProductName get replaced as they should, but version just gets "v" without the version number after it. I also tried just "[Version]" but that didn't work either. Am I doing something wrong or can you not write the version into the name?
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
hey What's up?
Okay I am trying to simulate the login screen that XP uses. Each opacid login box will be it's own form so i can control the opacity. The background form will be the MDI container for all the login forms.
But I don't want the border ARRGGGG around the entire MDI container!!!
Someone help....
Peace.
|
|
|
|
|
Wonder how to make a rubber band drawing with GDI+ in C#.
Have used SetROP2( R2_XORPEN ) in C++ before, but that little function seemes to be gone in GDI+.
Have tried to use interop with GDI, but there are quite a few functions that needs to imported and beeing lazy I want to know if there is a simpler way.

|
|
|
|
|
|
Thanks for the help. I thought I had looked everywhere, but apperantly not.

|
|
|
|
|
I have a string that will have a negative number as either the first 2 or 3 characters of it (including negative sign) immediately following this there is a colon :
How can I copy everything before this initial colon into another variable.
Reason for this: I need to perform some mathematical manipulation on this value but there is no way for me to get at it but via string because of the special characters.
Thanks
********************
* $TeVe McLeNiThAn
********************
|
|
|
|
|
|
That's what it is. Thank you so much. I have done the same thing before but couldn't remember it exactly.
Thanks again!
********************
* $TeVe McLeNiThAn
********************
|
|
|
|
|
Hi all
Is that possible to rearrange the order of delegates attached to an event and/or is it possible to enumerate them (without firing them)
thankx
|
|
|
|
|
Could you give an example of what you are trying to implement?
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
its not me - but I'll try and explain
a friend is adding a delegate to an event which already has other handlers on it - what he wants to do is put his handler to run first and then let the others go
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
|
I'm using the following code to export from a database to Microsoft Excel but I have one problem: The first record in the database is not getting exported correctly, any one can tell me why?
Many Thanks,
Jassim Rahma
string myConnString = ConnectionString;
OdbcConnection cn = new OdbcConnection(myConnString);
cn.Open();
cn.ChangeDatabase(TableName);
DataSet ds = new DataSet();
OdbcDataAdapter da = new OdbcDataAdapter(SQLstatement, cn);
da.Fill(ds, TableName);
if (MessageBox.Show("Do you want to Export the data?", "Export", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
string MyString;
StreamWriter myTextStream = new StreamWriter(txtOutput.Text);
for (int i= 0; i < ds.Tables[0].Columns.Count-2; i++)
{
MyString = ds.Tables[0].Columns[i].ToString() + ", ";
}
MyString = ds.Tables[0].Columns[ds.Tables[0].Columns.Count-1].ToString();
myTextStream.WriteLine(MyString);
MyString = "";
System.Data.DataTable tb = ds.Tables[0];
for (int i = 0; i < tb.Rows.Count-1; i++)
{
System.Data.DataRow dr = tb.Rows[i];
for (int j = 0; j < dr.Table.Columns.Count-2; j++)
{
MyString = MyString + dr[j].ToString() + ", ";
}
MyString = MyString + dr[dr.Table.Columns.Count-1].ToString();
myTextStream.WriteLine(MyString);
MyString = "";
}
myTextStream.Close();
myTextStream = null;
Process p = new Process();
System.Diagnostics.ProcessStartInfo pi = new ProcessStartInfo();
pi.UseShellExecute = true;
pi.WindowStyle = ProcessWindowStyle.Hidden;
pi.FileName= txtOutput.Text;
p.StartInfo = pi;
p.Start();
}
cn.Close();
cn.Close();
}
Jassim Rahma
|
|
|
|
|
I have a small doubt.We can see the debug combobox & font combobox at the top of the dotnet IDE.I want to add my own textbox.I know it is possible to do via addin.But will it come under commandbar or anyother thing.
|
|
|
|
|
I'm using C# to host a Flash file. This requires the flash object. When I build the executable, it creates 2 Dll's that are required for the program to run. Is there a way to compile the Dll's with the executable so that the program is self-contained? 2nd question: I am compiling on 2000 pro. Will users on other platforms be able to run this? 3rd: is .NET framework required on other machines in order for the app to run?
|
|
|
|
|
granthnk wrote:
1.there a way to compile the Dll's with the executable so that the program is self-contained?
Yes. Use the AxImporter.GenerateFromFile class (where the file is the Flash ActiveX object). Before you can use AxImporter, you need to import the System.Design.dll namespace.
granthnk wrote:
2. : I am compiling on 2000 pro. Will users on other platforms be able to run this?
Not Win95.
Provided you don't use ADO.NET, ASP.NET, users will be able to run your app with the sole .NET run-time installed. ( In addition, be sure to compile against .NET 1.0, otherwise you have to provide a .config file. )
granthnk wrote:
3. is .NET framework required on other machines in order for the app to run?
Yes, the .NET run-time is required. That's a major show stopper for small apps these days.
|
|
|
|
|
How do you get a control reference from it's handle under .Net? 
|
|
|
|
|
From MSDN:
Control.FromHandle Method
See Also
Control Class | Control Members | System.Windows.Forms Namespace | Handle | Parent
.NET Framework Security:
UIPermission for all windows to call this method. Associated enumeration: UIPermissionWindow.AllWindows
Returns the control that is currently associated with the specified handle.
public static Control FromHandle(
IntPtr handle
);
Parameters
handle
The window handle (HWND) to search for.
Return Value
A Control that represents the control associated with the specified handle; returns a null reference (Nothing in Visual Basic) if no control with the specified handle is found.
WebBoxes - Yet another collapsable control, but it relies on a "graphics server" for dynamic pretty rounded corners, cool arrows and unlimited font support.
|
|
|
|