Validating events
Hello,
How can i disable the Validating Event of all the controls of a form after a
click on a Cancel Button and close the Form?
Or how can fix the order of Validating events of the controls in a Form?
Thanks in advance.
Pascal Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57401
How to get App path of WinService
I was using Environment.CurrentDirectory when I tested my class in a winform
wrapper, but but now that I've move it to a WinService this gives me
"C:\WinNT\System32"
How can I get the Path of my assembly?
Thanks in Advance,
Byron Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57397
adding objects to the clipboard in .NET
I am unable to add a button to the clipboard. This is
required to do drag and drop of the object - button.
I am able to add a string to the clipboard. The following
is a summary of my steps. Any help greatly appreciated.
Button button2 = new Button();
DataObject data = new DataObject();
data.SetData("myButton", button2);
Clipboard.SetDataObject(data, true);
IDataObject data = Clipboard.GetDataObject();
object obj = data.GetData("myFormat"); // returns obj
== null
Button btn = (Button)data.GetData("myFormat"); //
returns btn == null
btn = (Button)data.GetData(typeof(Button)); // returns
btn == null
Thanks... Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57393
WinService Uninstall failed How do I clean up?
Hi, I followed the tutorial for setting up a WinService install and got the
messages below. If it's already on the system as it says then I should be
able to see it in the Services list but I didn't see it there.
How can I remove a WinService manually?
Thanks in Advance,
Byron
-------------
InstallUtil.InstallLog:
Running a transacted installation.
Beginning the Install phase of the installation.
See the contents of the log file for the c:\program files\twsm\ecpu\ecpu.exe
assembly's progress.
The file is located at c:\program files\twsm\ecpu\ecpu.InstallLog.
An exception occurred during the Install phase.
System.ArgumentException: Source eCPU already exists on the local computer.
The Rollback phase of the installation is beginning.
See the contents of the log file for the c:\program files\twsm\ecpu\ecpu.exe
assembly's progress.
The file is located at c:\program files\twsm\ecpu\ecpu.InstallLog.
The Rollback phase completed successfully.
The transacted install has completed.
------------
eCPU.InstallLog:
Installing assembly 'c:\program files\twsm\ecpu\ecpu.exe'.
Affected parameters are:
assemblypath = c:\program files\twsm\ecpu\ecpu.exe
logfile = c:\program files\twsm\ecpu\ecpu.InstallLog
Installing service eCPU...
Creating EventLog source eCPU in log Application...
Rolling back assembly 'c:\program files\twsm\ecpu\ecpu.exe'.
Affected parameters are:
assemblypath = c:\program files\twsm\ecpu\ecpu.exe
logfile = c:\program files\twsm\ecpu\ecpu.InstallLog
Restoring event log to previous state for source eCPU. Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57385
Can't start new projects in VS 2003
I can start a new project in VS2003, and don't put any controls or code in
form1, leave everything as VS writes it. Now I run it. Should just pop up a
blank form right? UhUh.
An unhandled exception of type "System.NullreferenceException' occurred
in Unknown Module.
Additional information: Object reference not set to an instance of an
object.
If you break there is no code for the current location. The app will build
without errors but I can't run it outside of vs either.
I can do this over and over again (definition of stupid) Once a few days
ago, I started one of these in a directory other than the default (actually
a subdirectory) and it worked and I could then write a small utility without
further problems. Runs fine in debugger still.
However it doesn't seem to make any difference where I put a new project
now.
I have read every forum posting on this problem and tried everything
suggested. Have also uninstalled and reinstalled the framework 1.1 as well
as VS twice to no avail.
Suggestions?
Many thanks Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57384
.Net App deployment - Removing files problem
How do I instruct the Windows installer to remove the entire application
when the user clicks Remove program from Windows control panel?
After a successful setup, any files created by the application in the
application folder are not removed. This is so when the program is
"removed" from the Windows control panel. This becomes a problem if the
user decides to reinstall the application in the same location. The
*old*/legacy files, e.g. app config files, may cause a problem with the
*new* installation of the application file.
My installer program was created with a "setup and deployment" type project
is Visual Studio.NET 2003 for a .NET v 1.1 Windows Forms application. It
appears all of the property pages in the VS.NET editor address installation
and few removal issues. I reckon I'm sniffing around for a solution in the
wrong place.
--
Peter O'Reilly Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57382
.Net App deployment - Removing files problem
How do I instruct the Windows installer to remove the entire application
when the user clicks Remove program from Windows control panel?
After a successful setup, any files created by the application in the
application folder are not removed. This is so when the program is
"removed" from the Windows control panel. This becomes a problem if the
user decides to reinstall the application in the same location. The
*old*/legacy files, e.g. app config files, may cause a problem with the
*new* installation of the application file.
My installer program was created with a "setup and deployment" type project
is Visual Studio.NET 2003 for a .NET v 1.1 Windows Forms application. It
appears all of the property pages in the VS.NET editor address installation
and few removal issues. I reckon I'm sniffing around for a solution in the
wrong place.
--
Peter O'Reilly Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57380
Changing the line colors of a Crystal Report at runtime?
Hello
I am running .NET 2003, Framwork 1.1, Crystal Report Version 9. I am writing
all my code in C#.
I have two questions:
1) Does anyone know if the line color in a chart on a Crystal Report can be
changed at runtime?
2) Does anyone know if a report can be created from a collection?
If the answer to either of these is yes, can you please supply sample code
in either VB.NET or C#.NET? Thanks in advance for your time!
Ken Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57378
inputbox for C#
Hello,
Just wondering if there is an equivelant available to C#
for quick string input. I am NOT using vb.net so i cant
use that version.
TIA,
Mel Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57374
Can't disable Add New row at bottom of Datagrid
--------------F34FF1FF13222AD377793457
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Based on this post from Clay Burch and the SyncFusion FAQ website, I
tried to disable my add new row at the bottom of my datagrid. However
the add new row still shows up. When I click on it my app crashes. Can
anybody look at the routine I've included at the bottom and tell me what
I did wrong?
Thanks,
Steve
Clay's Post:
You can do this by getting at a dataview associated with the datagrid,
and
setting its AllowNew member. Here is one way you can do this.
CurrencyManager cm =
(CurrencyManager)this.BindingContext[dataGrid1.DataSource,
dataGrid1.DataMember];
//no adding of new rows
((DataView)cm.List).AllowNew = false;
===================================
Clay Burch
Syncfusion, Inc.
My Routine:
private void loadMessagesDataGrid(ref DataTable msgsDataTable)
{
DateTime startDateTime = DateTime.Now.AddDays(-1);
string messagesSelectStr = "SELECT id, fldtimestamp, "+
"payload, direction, state, transNum, port "+
"FROM messages "+
"WHERE port = "+Port+" "+
"AND fldtimestamp > #"+startDateTime+"# "+
"ORDER BY fldtimestamp DESC";
// Create data adapter objects
MessagesDataAdapter = new OleDbDataAdapter(messagesSelectStr,
Db.getConnection());
MessagesDataAdapter.TableMappings.Add("Table1", "messages");
createMessagesInsertAndUpdateCommands(MessagesDataAdapter, Db);
try
{
MessagesDataAdapter.Fill(dgDataSet, "messages");
}
catch (Exception ex)
{
Log.WriteLine("Exception Filling messagesDataAdapter: "+ex.Message);
return;
}
DataGridTableStyle messagesStyle = null;
try
{
messagesStyle = new DataGridTableStyle();
messagesStyle.MappingName = "messages";
}
catch (Exception ex)
{
Log.WriteLine("Exception getting DataGridTableStyle: "+ex.Message);
return;
}
// HERE IS THE FIRST LINE SUGGESTED BY SYNCFUSION
CurrencyManager cm = (CurrencyManager)BindingContext[dgDataSet,
"messages"];
try
{
int numCols = dgDataSet.Tables["messages"].Columns.Count;
DataGridColoredTextBoxColumn aColumnTextColumn ;
for(int i = 0; i < numCols; ++i)
{
aColumnTextColumn = new DataGridColoredTextBoxColumn(this);
aColumnTextColumn.HeaderText =
dgDataSet.Tables["messages"].Columns[i].ColumnName;
aColumnTextColumn.MappingName =
dgDataSet.Tables["messages"].Columns[i].ColumnName;
if(i == 1) // fldtimestamp
{
aColumnTextColumn.Format = "g";
}
messagesStyle.GridColumnStyles.Add(aColumnTextColumn);
}
messagesStyle.GridColumnStyles["fldtimestamp"].Width = 110;
messagesStyle.GridColumnStyles["payload"].Width = 250;
messagesStyle.GridColumnStyles["direction"].Width = 0;
messagesStyle.GridColumnStyles["state"].Width = 75;
messagesStyle.GridColumnStyles["transNum"].Width = 0;
messagesStyle.GridColumnStyles["port"].Width = 0;
messagesDataGrid.TableStyles.Clear();
messagesDataGrid.TableStyles.Add(messagesStyle);
// HERE IS THE SECOND LINE SUGGESTED BY SYNCFUSION
((DataView)cm.List).AllowNew = false;
}
catch (Exception ex)
{
Log.WriteLine("Exception setting up TableStyles: "+ex.Message);
return;
}
// bind messages data grid with messages data table
try
{
msgsDataTable = dgDataSet.Tables["messages"];
messagesDataGrid.DataSource = msgsDataTable;
msgsDataTable.DefaultView.Sort = "fldtimestamp DESC";
}
catch (Exception ex)
{
Log.WriteLine("Exception: "+ex.Message);
}
}
--------------F34FF1FF13222AD377793457
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<br>Based on this post from Clay Burch and the SyncFusion FAQ website,
I tried to disable my add new row at the bottom of my datagrid. However
the add new row still shows up. When I click on it my app crashes.
Can anybody look at the routine I've included at the bottom and tell me
what I did wrong?
<br>Thanks,
<br>Steve
<p>Clay's Post:
<p><font face="Courier New,Courier"><font size=-1>You can do this by getting
at a dataview associated with the datagrid, and</font></font>
<br><font face="Courier New,Courier"><font size=-1>setting its AllowNew
member. Here is one way you can do this.</font></font>
<br><font face="Courier New,Courier"><font size=-1></font></font> <font face="Courier New,Courier"><font size=-1></font></font>
<p><font face="Courier New,Courier"><font size=-1>CurrencyManager cm =</font></font>
<br><font face="Courier New,Courier"><font size=-1>(CurrencyManager)this.BindingContext[dataGrid1.DataSource,</font></font>
<br><font face="Courier New,Courier"><font size=-1>dataGrid1.DataMember];</font></font><font face="Courier New,Courier"><font size=-1></font></font>
<p><font face="Courier New,Courier"><font size=-1>//no adding of new rows</font></font>
<br><font face="Courier New,Courier"><font size=-1>((DataView)cm.List).AllowNew
= false;</font></font><font face="Courier New,Courier"><font size=-1></font></font>
<p><font face="Courier New,Courier"><font size=-1>===================================</font></font>
<br><font face="Courier New,Courier"><font size=-1>Clay Burch</font></font>
<br><font face="Courier New,Courier"><font size=-1>Syncfusion, Inc.</font></font>
<p>My Routine:
<br> private void loadMessagesDataGrid(ref DataTable msgsDataTable)
<br> {
<br> DateTime startDateTime = DateTime.Now.AddDays(-1);
<br> string messagesSelectStr = "SELECT id, fldtimestamp, "+
<br> "payload, direction, state, transNum, port "+
<br> "FROM messages "+
<br> "WHERE port = "+Port+" "+
<br> "AND fldtimestamp > #"+startDateTime+"# "+
<br> "ORDER BY fldtimestamp DESC";
<p> // Create data adapter objects
<br> MessagesDataAdapter = new OleDbDataAdapter(messagesSelectStr,
Db.getConnection());
<br> MessagesDataAdapter.TableMappings.Add("Table1", "messages");
<p> createMessagesInsertAndUpdateCommands(MessagesDataAdapter,
Db);
<p> try
<br> {
<br> MessagesDataAdapter.Fill(dgDataSet, "messages");
<br> }
<br> catch (Exception ex)
<br> {
<br> Log.WriteLine("Exception Filling messagesDataAdapter:
"+ex.Message);
<br> return;
<br> }
<p> DataGridTableStyle messagesStyle = null;
<br> try
<br> {
<br> messagesStyle = new DataGridTableStyle();
<br> messagesStyle.MappingName = "messages";
<br> }
<br> catch (Exception ex)
<br> {
<br> Log.WriteLine("Exception getting DataGridTableStyle:
"+ex.Message);
<br> return;
<br> }
<br>
<br>// HERE IS THE FIRST LINE SUGGESTED BY SYNCFUSION
<br> CurrencyManager cm = (CurrencyManager)BindingContext[dgDataSet,
"messages"];
<br> try
<br> {
<br> int numCols = dgDataSet.Tables["messages"].Columns.Count;
<br> DataGridColoredTextBoxColumn aColumnTextColumn ;
<br> for(int i = 0; i < numCols; ++i)
<br> {
<br> aColumnTextColumn = new DataGridColoredTextBoxColumn(this);
<br> aColumnTextColumn.HeaderText = dgDataSet.Tables["messages"].Columns[i].ColumnName;
<br> aColumnTextColumn.MappingName = dgDataSet.Tables["messages"].Columns[i].ColumnName;
<br> if(i == 1) // fldtimestamp
<br> {
<br> aColumnTextColumn.Format = "g";
<br> }
<br> messagesStyle.GridColumnStyles.Add(aColumnTextColumn);
<br> }
<p> messagesStyle.GridColumnStyles["fldtimestamp"].Width
= 110;
<br> messagesStyle.GridColumnStyles["payload"].Width
= 250;
<br> messagesStyle.GridColumnStyles["direction"].Width
= 0;
<br> messagesStyle.GridColumnStyles["state"].Width =
75;
<br> messagesStyle.GridColumnStyles["transNum"].Width
= 0;
<br> messagesStyle.GridColumnStyles["port"].Width = 0;
<p> messagesDataGrid.TableStyles.Clear();
<br> messagesDataGrid.TableStyles.Add(messagesStyle);
<p>// HERE IS THE SECOND LINE SUGGESTED BY SYNCFUSION
<br> ((DataView)cm.List).AllowNew = false;
<p> }
<br> catch (Exception ex)
<br> {
<br> Log.WriteLine("Exception setting up TableStyles:
"+ex.Message);
<br> return;
<br> }
<p> // bind messages data grid with messages data table
<br> try
<br> {
<br> msgsDataTable = dgDataSet.Tables["messages"];
<br> messagesDataGrid.DataSource = msgsDataTable;
<br> msgsDataTable.DefaultView.Sort = "fldtimestamp DESC";
<br> }
<br> catch (Exception ex)
<br> {
<br> Log.WriteLine("Exception: "+ex.Message);
<br> }
<br> }
<br>
</body>
</html>
--------------F34FF1FF13222AD377793457-- Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57371
Tab Control with Combo Box
I have a windows form that contains a tab control. On
one of the tabs I have a combo box bound to a datatable.
When I first enter the tab I initialize the selectedindex
of the combobox to -1. I then type text into the combo
box that does not match any entries in the dropdown
list. If I then choose a different tab and return to my
tab with the combo box, the selectedindex has been
changed to 0 and the text I entered is replaced with the
text from list item 0. Why does the combo box not retain
a selectedindex of -1 with the text I entered? How can I
correct this?
Thank You,
Don Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57370
Help with ListView
I am trying to get data from a CollectionBase derived class into a ListView.
Currently the output is one continuous line of data that is of Boolean type
e.g. True True False True False False False True .
No other data or header information is displayed.
public class RecFormCtxSaved
{
private Boolean enabled;
private Boolean selected;
private string column;
private string text;
}
private void createListView()
{
ListViewItem lvi;
this.listView1.Columns.Add("Enable", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Select", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Column", 50, HorizontalAlignment.Left);
this.listView1.Columns.Add("Text", 50, HorizontalAlignment.Left);
foreach (RecFormCtxSaved rec in coll)
{
lvi = new ListViewItem();
lvi.Text = rec.Enabled.ToString();
lvi.SubItems.Add(rec.Selected.ToString());
lvi.SubItems.Add(rec.Column);
lvi.SubItems.Add(rec.Text);
this.listView1.Items.Add(lvi);
}
} Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57367
Wish List Item - Slim CLR For Download
For Java code, there is a "slim" download from Sun that contains just
enough code to host an applet plus the capability to download other
classes/jars as needed. There are seperate options from Sun (SDK
download containing jar.exe, etc) for those that need more.
I wish the same could be done for the .NET CLR; I would like to host
"C# applets" in my web pages, but a 20mb download plus a reboot is a
lot to ask.
Why can't Microsoft distribute a "slim" CLR download weighing in
around 5mb that just contains the base classes for XML, Remoting,
System.Data, and WinForms, a "medium" one with some more features, and
still distribute the full sized one?" Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57366
OpenFileDialog ShowDialog hangs
Hi there,
has anyone run into this problem? I have a simple winforms app that
uses the OpenFileDialog to open a file. If I choose to open a file
from a different machine on my network everything is fine. However, if
I now close down my app and shutdown the other machine and try again
the OpenFileDialog hangs. The call stack shows that it is waiting in
RunFileDialog.
It looks as though the app persists the current directory somewhere,
but runs into trouble when that path is no longer available. When I
try the same thing with Word it goes back to My Documents when the
network path is not available.
Any ideas?
Thanks,
Tom Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57365
Lock fields
Hi
I am trying to lock fields on my form (VB.NET), so that they cannot be
edited by the user. So far I have accomplished my goal for the text box
by setting its read only property. But what should I do for combo box
and mask edit box (added as an reference). list box etc. I don't want to
use the enabled property, since that makes the controls text to fade or
not seen prominently.
Does anyone know how can we achieve this in VB.NET ??
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57359
Datagrid question
I've a editable datagrid where the user sometimes needs to enter more
characters than can be displayed on the screen.
The current behavior is, I believe, a bit confusing to the user. When
they fill up the visible portion of the cell, the entered text moves
left off the screen, leaving the cursor in the left-most position of
the cell, ready to accept more data.
This is confusing because it appears that the entered text has
"disappeared". I'd rather have it behave like a standard textbox,
where it scrolls one character at a time when the visible width is
reached.
Is there a property that controls this behavior?
TIA. Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57358
No touch deployment - offline question.
Hi, I've been reading a lot about no touch deployment and it could be the
solution to my design. But I have a question:
What happens if the client is not 'connected'?
Is there anyway to run the app from the client chache?
Where can I find information about that?
I've read in some articles on MSDN about this posibility, but I can't find
any info about that.
Thanks in advance,
JOSE Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57350
question on docking
(sorry if you see this message twice - I got a "message expired" on my
last post)
Hi,
My GUI is driving me crazy. It's a little complicated, so I'll explain
the part that I find troubling:
I have a Panel which includes a UserControl of mine. The UserControl is
put in the Panel at runtime.
Although UserControl has Dock=Fill, resizing the Panel doesn't resize
the UserControl. (I check by hitting a breakpoint and using the
Immediate window)
How is this possible? Is there some other property I should set? Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57349
Framework Configuration
Hi!
As I can make to configure framework with one setup. The
configuration that I am to speak is:
Control Panel->Administrative Tools->Microsoft .NET
Framework 1.1 Configuration:
Run Time Security Police->Machine->Code Groups-
>All_code->Local_Intranet Zone and to insert a new rule
to have permissions to accede to an application that if
finds in another machine.
thx,
David Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57348
dll version
When I call a class in a dll from an application, how do I tell the version
of the dll as oposed to the application calling the dll?
Andrew Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57346
basic question on docking
Hi,
My GUI is driving me crazy. It's a little complicated, so I'll explain
the part that I find troubling:
I have a Panel which includes a UserControl of mine. The UserControl is
put in the Panel at runtime.
Although UserControl has Dock=Fill, resizing the Panel doesn't resize
the UserControl. (I check by hitting a breakpoint and using the
Immediate window)
How is this possible? Is there some other property I should set? Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57344
Problem with localized usercontrol
Hi
i must develop an multilanguage application (german,
italian). I have a localized winform with the description
in this 2 languages. Now i have a Usercontrol which is
localized too. If i would like drag this usercontrol from
the toolbox of the vs.net into my winform the vs.net give
me the following error:
An exception occurred while trying to create an instance
of PFUtilityLibrary.USCWeekDaysCheck. The exception
was "Could not find any resources appropriate for the
specified culture (or the neutral culture) in the given
assembly. Make sure "USCWeekDaysCheck.resources" was
correctly embedded or linked into
assembly "PFUtilityLibrary".
baseName: USCWeekDaysCheck locationInfo:
PFUtilityLibrary.USCWeekDaysCheck resource file name:
USCWeekDaysCheck.resources assembly: PFUtilityLibrary,
Version=1.0.1361.25253, Culture=neutral,
PublicKeyToken=null
I use the Framework 1.0, somebody have an idea what is
the problem?
thx Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57341
possible listbox BeginUpdate() / EndUpdate() bug?
Hi
I have the following code which lodes names of=20
wordtemplates into my .NET windowsforms app:
--
//lsbTemplate.BeginUpdate();
lsbTemplate.Items.Clear(); =09
System.IO.DirectoryInfo di =3D new System.IO.DirectoryInfo( =20
p_sPathToTemplates );
System.IO.FileInfo[] arFi =3D di.GetFiles( "*(*" +=20
p_sHelpDesk + "*).dot" ); =09
if( arFi.Length =3D=3D 0 )
{
lsbTemplate.Sorted =3D false;
//lsbTemplate.EndUpdate();
return;
}
else
{
lsbTemplate.Sorted =3D true;
}
=09
foreach( System.IO.FileInfo fi in arFi )
{ =09
if( fi.Name.IndexOf( "~" ) < 0 )
{//DO not show templates which include ~ ...
lsbTemplate.Items.Add( fi.Name );
}
} =09
//lsbTemplate.EndUpdate();=09
---
Notice the calls to BeginUpdate and EndUpdate at the=20
beginning and the end. When theese lines of code are=20
active ( not commented out ) the listbox doesn't show any=20
items if there's only one items loaded. Actually, by=20
clicking the listbox you can click the top item, but there=20
is no text shown. If there are 2 or more items all items=20
show up ok.
After commenting out BeginUpdate and EndUpdate the listbox=20
show's this one item ok.
I haven't been able to think of any reason for this. I=20
would like to use BeginUpdate and EndUpdate because it=20
boost's GUI performance when updating the listbox, but=20
until this is resolved I will skip them.
Any hint's welcomed, best regards, =C1g=FAst from Iceland Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57339
standard commands display text
hello,
in System.Windows.Forms.Design.MenuCommands is a class StandardCommands with
static members for some standard commands iE: StandardCommands.Delete
i want my document implement some of these commands and the toolbar show
these commands.
how can i get culture specific names of these commands (iE: engl. "Delete")
?
how can i get the toolbar bitmap? (16x16)
Frank Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57338
No Touch Deployment.
No Touch Deployment.
I use "No Touch Deployment" for my Window Forms
application. The question is why my EXE-file is downloaded
three times and not just one.
My shortcut:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
http://ozzy/conet/client/bin/co.win.exe?server=ozzy
IIS Logfile:
cs-method cs-uri-stem cs-
uri-query sc-status sc-bytes cs-
bytes time-taken
GET /conet/client/bin/co.win.exe
server=hk0073.config 200 823562
232 16766
GET /conet/client/bin/co.win.exe
server=hk0073 200 823562
225 17328
GET /conet/client/bin/CO.Win.DLL -
404 4203 211
0
GET /conet/client/bin/CO.Win/CO.Win.DLL -
404 4203 218
0
GET /conet/client/bin/bin/CO.Win.DLL -
404 4203 215
0
GET /conet/client/bin/bin/CO.Win/CO.Win.DLL -
404 4203 222
0
GET /conet/client/bin/CO.Win.EXE -
200 823562 211
17594
Thanks in advance! Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57337
Update dataset
I have a Windows form that does a insert and then a update to a dataset.
When I do the insert/update and all the fields are filled in it works fine.
But when there is a null value or when the field is empty I get the usual
update error.
I'm using a Access database and none of the fields are required.
I don't want to have to make a seperate object to merge the changes like
most of my forms do.
VB6 had shortcuts and I would like to use one in VB.NET
I want to have a If Then Else or something to use as a shortcut around this.
Like:
If textbox1 = NULL then
skip
Else
Add textbox1.text = recordset.....
I have found limited info on the Null field problem. Something like
System.DBNULL
In the old way I would do something like a IIF(NULL) etc...
Does anybody have any ideas.
Thanks.
Erik Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57319
.net bug in order of events w/ listview control??
i've found what appears to be a bug and i'm looking for
confirmation. as a result of problems i found w/ an
application i made, i created a simple vb.net program
that includes a single form with a listview control, a
text box and a button. i coded events for ENTER and
LEAVE for the listview control and textbox. i also coded
a SELECTEDINDEXCHANGED event and a CLICKED event for the
listview. each event writes to a string that it
occurred there is no other code. the button is used to
display the string. finally, i hard-coded two items into
the listview control.
i'm running a windows xp computer with visual studio.net
installed and .net 1.1. on that computer, when i run the
test program, if i click on item one in the listview
control, then click on the text box, then click back to
the listview control on item two, the following events
occur....
entered listview->clicked on listview->left listview-
>entered textbox->left textbox->entered listview-
>selected index changed->selected index changed->clicked
on listview
aside from the SELECTEDINDEXCHANGED event getting called
twice, which i dont' understand, it works as i would
expect. however, if i run this same program on any other
computer (that doesn't have visual studio.net installed),
the order of events is different. what i get is...
entered listview->clicked on listview->left listview-
>entered textbox->selected index changed->selected index
changed->left textbox->entered listview->clicked on
listview
!!! the SELECTEDINDEXCHANGED event gets called before the
event for leaving the textbox. what's the deal with
this? is this a bug or am i missing something? if it is
a bug, it seems like a fairly serious one (for me at
least).
thanks,
glenn Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57317
Column order when binding DataGrid with typed collection
I need help for setting the order of columns in a=20
DataGrid populated by binding it with a fixed-type=20
collection of custom objects. Actually I don=B4t even know=20
where to start.
The binding was easy and works with a simple
myDataGrid.DataSource =3D myCollection;
But the order of the columns messes the data; related=20
columns appear separated each other. How can I specify=20
column ordering? Should I change the order in the=20
DataGrid (How?). Or there is a way to make Reflection=20
work automatically on the type to get the properties and=20
fields on the right order, so whenever I bind them with a=20
grid the columns appear in the right place? Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57315
GUI similar to Visual Studio .NET
Dear Everybody,
I am designing the editor which has very similar GUI to
Visual Studio.NET.(Main menu, toolbar, toolbox, Solution
Explorer, properties, Editing area, etc).
Specially, because this editor handle multiple file
format, a file will be open by solution Explorer and
correspoding Editor form shoud be opened. As an object is
modifid by properties box in VS, so is the object inside
file.
Is there any similar demo source code?
Thanks,
Jongmin Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57312
master detail sub-detail not updating on row click
I have a strongly-typed DataSet with 3 DataTables related to one
another such that there is a 1-many between master and detail and
1-many between detail and sub-detail.
The DataSet is bound to 3 DataGrids -- 1 DataTable per Grid. I bound
like this:
gridMaster.DataSource = dataset
gridMaster.Member = "tableMaster"
gridDetail.DataSource = dataset
gridDetail.Member = "tableMaster.relateMasterToDetail"
gridSubDetail.DataSource = dataset
gridSubDetail.Member = "tableMaster.relateDetailToSubDetail"
The DataTables are populating with the correct information from the
database.
Here is the problem:
The Sub-detail grid does not refresh with the correct records when the
selected rows of the Master and Detail change. Changing rows in the
Master grid DOES change the Detail grid to show only those rows that
share an ID with the Master grid's current row. However, the
sub-detail does not change to show the records related to the new ID
selected in the Master and Detail grids.
Would greatly appreciate any help on this.
Thx. Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57306
Control when a new row is added to a datagrid
Shortly after one starts entering data on the last row of a datagrid, a
blank (*) row is created beneath. How can I control when this happens?
For each column (cell) I've added validation. What happens when the blank
row is added is that the Leave event of the current cell fires, in turn
fireing the Validating event. For now I handle them as exceptions and simple
ignore them. But there must a better way!!
Regards,
Kenneth Bohman Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57299
Determine datagrid's currently sorted column
I need to figure out how, in code, to determine a bound datagrid's currently
sorted column and then to change it. The result will be used in a context
menu with an Arrange By -> list similar to Outlook.
Any ideas?
Brian Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57295
C#.NET browser cancelling action on loading a page the first time
We wrote a small C# web browser stripped of all functionality except
for going from link to link to load a webpage we wrote ourselve as
well. Everything is working great, except for a really annoying minor
problem that must be fixed.
For some users under certain access groups (active directory), on some
machines, no matter what url we are trying to load, the first webpage
loaded with the browser will return an "ACTION CANCELLED" page. For
other users (usually ones with more rights), the first webpage will
load properly.
If we use Internet Explorer to load the webpage, no matter who the
users are, the first page will load just fine.
Basically, if we get an "Action cancelled" page, we can just hit
refresh and it'd load properly. It's like the C#.NET browser is
trying to goto a site that doesn't exist and cancels itself. In fact,
if we "catches" the "action cancelled" page within the code and then
reload the same page, it'd load properly.
Any help would be wonderful, thanks in advance. Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57293
Simple event question....
Is it possible to determine whether a SelectIndexChanged event was
caused by a user making a selection or something changing in the
DataSet to which it is connected? I checked e:EventArgs and
sender:Object, but e is empty and I don't see anything helpful in
sender.
In my event handler for SomeCombo_SelectedIndexChanged, I need to be
able to do certain things *only* if it was the user that changed the
selection, not if the event is firing because the connected DataSet
changed.
Thanks! Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57288
How to create Multiple fields in a ListBox
I have a class derived from CollectionBase. I would like to display the
fields in the collection in the ListBox. The class has 4 fields of type
boolean, boolean, string, string and I would like to display the booleans
as check marks ( x = check mark). The output looking like:
x x title 1 author 1
x title 2 author 2
x title 3 author 3
title 4 author 4
Any thoughts or suggestions would be appreciated. I am looking to
do this WITHOUT using a DataGrid.
Thanks,
Dave
DavidElliott@BellSouth.net Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57286
Login dialog
Hi there,
I'm writing a .net Windows application in C#. I have 2 forms: the MainForm
and the Login. The MainForm opens the Login as Dialog from the MainForm's
constructor, and Login asks for username/password. I get these data from the
MainForm and check using a Web service that they're ok. If username/password
are not ok, I want to close the whole application, but I don't know how
(this.Close() doesn't work). Can I close the app from the MainForm's
constructor? Should I call the Login dialog and web service somewhere else?
Thanks,
Alejandro. Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57285
Red Cross / Red X on DataGrids with Paint Override & BindingManagerBase
Hello everyone,
I am having a recurrent problem that I'm unable to find a solution to.
Everyday, someone in the office using the application developed would
get an error. After going through the error-trapping message, the
DataGrid on the form would turn into a big red X with white
background. If the user closes the form, and reopen it, the big red X
will go away, and the error won't happen again. Even if they repeat
exactly what they were doing 10 more times, the error just wouldn't
happen.
It's frustrating because I'm unable to duplicate the error at will.
Some computers seem to get the problem once or twice per day while
others have never seen this error.
Some pertinent information ~
Every single grid has a TableStyle using derived
DataGridTextBoxColumn. The DataGridTextBoxColumn overrides Paint()
and paints each cell as specified. The code for the override is
originally from
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q
but we modified it to modify the textbox content before drawing it on
the DataGrid.
The changes we made can be found on
http://www.rodtv.com/Class_DataGridFormattableTextBoxColumn.txt
There's another thread on the NGs that I found via Google Groups that
seems similiar. The paint override does use CurrencyManager, and
according to Daniel Herling [MS], it's a known issue. But the post
was long ago, so I'm wondering if the issue had been fixed already.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=O7W79dr%24BHA.1836%40tkmsftngp05
If anyone can help, I'd really appreciate it! Thanks for any help in
advance! Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57283
Application Structure
Hi
I am working on an application that has several modules. Each module is
represented by an icon on an outlook like list bar on the left. I want users
to be able to select modules at installation and in the installed app the
listbar icons should reflect the modules installed. The question is how
should I structure my application in the first place (separate assemblies,
classes, what?) and how would it relate to the installation wizard to allow
me to do what I want to do?
Thanks
Regards Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57280
Restrict clicking child datagrid columns
A windows form contains
a parent datagrid (let's say order)
a child datagrid (let's say order details)
One user prefers to use the mouse to navigate between the data grids. When
stressed the same user often clicks any column in the child datagrid and
starts typing away. Trying for example to type the article number in the
units column.
How can I restrict so that whenever the user clicks a new (blank) row in the
child datagrid the leftmost column gets the focus?
How can I even check when that a new (blank) row has been activated? As far
as I can see, the events for the datagrid fire only when the row has
actually been added to a datagrid
Or is there a better solution. Validation events only annoys the user and
this question has become kind of a political issue now. So I would be
grateful for any help.
Kind regards,
Kenneth Bohman Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57277
Unhandled exception on .ShowDialog()
I have the following code:
Dim BuilderForm As frmBuilder
BuilderForm = New frmBuilder(_LastChangedFile.Path)
BuilderForm.Refresh()
BuilderForm.ShowDialog()
And get the following exception on the last line:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.windows.forms.dll
Additional information: DragDrop registration failed.
Any ideas?
I've tried compiling using .NET 2002 and .NET 2003 and get the same error.
I wasn't getting this error when running on Server 2003 if that's any help!
When looking at the build output, I get the following under .NET 2003:
'DefaultDomain': Loaded
'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols
loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No
symbols loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.dr
awing.dll', No symbols loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system.directoryservices\1.0.5000.0__b03f5f7f11d50a3a
\system.directoryservices.dll', No symbols loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system.messaging\1.0.5000.0__b03f5f7f11d50a3a\system.
messaging.dll', No symbols loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system.serviceprocess\1.0.5000.0__b03f5f7f11d50a3a\sy
stem.serviceprocess.dll', No symbols loaded.
'auto': Loaded
'c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.
dll', No symbols loaded.
Is this ok? Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57273
set focus
vb.net
windows form
I have a vb.net using a command button to open an external program using the
system.Diagnostics.Process.Start
What I want to do is when the external program starts have the focus set
back to the vb.net form without having to move the mouse over it. How can I
do this
Thanks Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57271
Using Visual C++ .NET based custom controls from the Toolbox
Has anybody ever succeeded in making a custom control written in Visual
C++ .NET available for drag-and-drop use via the Toolbox?
Searching the Web and MSDN uncovered lots of helpful information. I
learned that I had to put my control into a strong-named assembly and
add the latter to the global assembly cache. Everything worked out
alright: I could use my custom control from my test application as long
as I added the necessary code by hand. But when I tried to automate this
tedious process by adding Toolbox support to my control I seemed to bump
into "C# only" signs everywhere. While I managed to put my control into
the Toolbox, dragging it on a form results in a frustrating
"Exception from HRESULT: 0x8005050A"
message box.
Is Windows Forms support for Visual C++.NET really that flaky? I would
be very grateful for advice or pointers to online resources I have missed.
Gerhard Menzl Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57269
System.UnauthorizedAccessException
I get this exception when my application wants to delete a file.
the programm load a dll-file from a server and writes the stream into
a file with this code:
HttpWebRequest wr =(HttpWebRequest)WebRequest.Create
("http://localhost/Server/Tools/"+strFileName);
HttpWebResponse ws = (HttpWebResponse)wr.GetResponse();
Stream str = ws.GetResponseStream();
...
FileStream fstr = new FileStream(strFileName,
FileMode.Create,FileAccess.Write);
fstr.Write(inBuf, 0, bytesRead);
str.Close();
fstr.Close();
but when I start this function a second time (and the session is also
running), I get the exception.
so what can I do? how can I stopp using the dll-file to delete it? Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57268
How do I cancel the context menu appearing ??
Hi All,
Ho can I (in code) stop and contextmenu appearing.
I have a listview, and when there are no items, I want to stop the listview
from appearing in the mouse down event.
Thanks
Alex Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57265
organising include files for vc++
bit of basic help needed here, thanks:
I create a class, with myclass.cpp and myclass.h
Now,
should I add "#include myclass.h" to
a) form1.h
as it is now,
and I think this is why myclass is OUT of the "My" namespace,
(where "using namespace My;" is in form1.cpp)
or
b) form1.cpp (above the "using namespace My" line)
where I guess myclass will remain out of the namespace,
or
c) form1.cpp (below the "using namespace My" line)
[btw: why, when adding a button, checkbox etc,
is the programmer directed to the form1.h file
in which to add the functional code ?]
thanks
tom Tag: Re;ÕÒɽÎ÷µÄÅóÓÑ Tag: 57261