|
Hi,
assuming frmHistory and frmHistoryDetails are rather similar, they should have a common ancestor
(they both inherit from a third class, or one would inherit from the other), I'll call it FormCommon.
Then do:
FormCommon newForm=null;
if (strReportName == PRICEHISTORY) newForm=new frmHistoryDetails();
else if (strReportName == PRICEHISTORYBEST) newForm=new fmrHistory();
if (newForm!=null) {
newForm.ReportNameGet(strReportName.ToLower());
newForm.SecurityID = intSecurityID;
newForm.ShowDialog();
newForm.Dispose();
}
BTW: ToString() is redundant in ToLower().ToString()
|
|
|
|
|
Dear All,
In window application
can i set radio buton text at left instead of right
Thanks you in advance
Manoj
|
|
|
|
|
Have you even looked at the properties? look at RightToLeft,
either in the designer or in code:
radioButton1.RightToLeft = RightToLeft.No;
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Dear All,
can i change border color of panel and form as well at design time.
if no how to change it at run time.
Thnaks you lot in advance.
Manoj Batra
|
|
|
|
|
Hi everybody,
I'm using DevComponents DotNetBar in my project. When working with RibbonControl, I need to get all ButtonItem following function :
private List<buttonitem> GetAllRibbonButtonItem()
{
code ??
}
Has anyone got any solutions ?
Thanks and regards
|
|
|
|
|
Hi All
I am newbie to C# XML and Serialization!
I wrote a class serialized in XML.
Data are retrieved correctly, the only think is that
the methon Init is not called at the end of the Serialization.
I also tried to use the ISerializationCallback but it doesn't work!
Do you know whit Init is not called?
Many Thanks to everybody and have a nice day
ManuStone
[Serializable]
public class HomeCommandCollection
{
[XmlArray("HomeCommandArray")]
public HomeCommand[] Commands;
[OnDeserialized]
public void init(StreamingContext cs)
{
InitCommand();
}
}
|
|
|
|
|
The OnDeserialized is not supported by XML serialization (e.g. System.Xml.Serialization). It's only supported by Binary or SOAP serialization. I don't think there is an equivalent attribute for XML serialization.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
What if you implement the ISerializable interface? Then, in the constructor, I think you can call your "InitCommand();" method.
public class myClassName {
public myClassName(SerializationInfo info, StreamingContext ctxt) {
m_Value = (m_ValueType)info.GetValue("Whatever", typeof(m_ValueType));
InitCommand();
}
public void GetObjectData(SerializationInfo info, StreamingContext ctxt) {
info.AddValue("Whatever", m_Value);
}
} Hope this helps!
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
This may be a silly/stupid question if so I apologise.
I have a class that handles dynamic changes of form components i.e. creation, deletion and alteration the class also handles events raised by components. My question is; is it okay to make safe thread calls to components (using delegates) even if the component(s) are already being accessed in a thread safe way?
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
|
Hey Pete thanks very much for your response. Much appreciated.
Have a good one.
When the game is over the Pawn and the King go into the same box.
|
|
|
|
|
I have a windows form application in which have a separate thread for a server. If i set a breakpoint somewhere inside the server code part, visual studio locks up for about 7 seconds and then if i press F10 or F11 nothing happens and the program does not stop at the next line. It behaves as if i have pressed F5 but the program does not work as expected, for example a client program cannot connect to the server anymore.
If i don't set any breakpoints the program works as it should.
I just want to debug the program...
This problem appeared when i reinstalled Visual Studio. I also tried Service Pack 1, but it's the same.
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
You might want to try the following and see if it helps:
Tools -> Options -> Debugging -> General -> Uncheck "Enable property evaluation and other implicit function calls"
You'll only want to shut this off when dubugging mutli-threaded applications. I can't remember the exact reason, but I once found a message on MSDN about this when I was having problems debugging an application that used the BackgroundWorker Class.
|
|
|
|
|
It works! Thank you!
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
Can any one can tell me how i Export DataTable To Excel file.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Hi,
see this link and modify if you wanna do something different,
Link[^]
Link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
I create a dataview of my dataset, then i add a rowfilter to it then when i set the datasource to a datagrid works perfectly.
But when i loop trough it so i can add it to a treeview i wont filter,
Im clueless.
DataView dataView = dataset_filter.Tables[0].DefaultView;
dataView.RowFilter = "artiestnaam like '" + tb_filter.Text + "%'";
dg_overzichtgroep.DataSource = dataView;
//loop trough dataset add names to TreeView
for(int i=0; i < dataView.Table.Rows.Count; i++)
{
string s = dataView.Table.Rows[i]["artiestNaam"].ToString();
if(tv_filter.InvokeRequired == true)
{
//use invoke to add to the treeview becuase of the seperate thread
tv_filter.Invoke(new UpdateTextCallback(this.AddToTreeView), new object[]{s});
}
else
{
tv_filter.Nodes.Add(s);
}
}
Thanks!
|
|
|
|
|
Do you have this working yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello,
I am developing an application and i want that ContextMenuStrip will appear on tree view subnodes Not on nodes.
+MasterNode
Node1
SubNode1
Node2
SubNode2
Node3
Subnode3
I want context menu strip should appear only on subnodes not on nodes.
|
|
|
|
|
You can either
1. Set the context menu individually for each node rather than for the entire treeview
or
2. Set the nodes tag property or something to indicate whether it should display the treevies's context menu (Or create your own and inherit from System.Windows.Forms.TreeNode and add a boolean property) and check that value in the events that fire before the comtext menu is shown to disable it.
|
|
|
|
|
In my project i use the system trace to trace error log.
but do someone help to know where is the path of the file that contain this trace.
best regards,
dghdfghdfghdfghdgh
|
|
|
|
|
The debug messages are sent to the Output window (Debug -> Windows -> Output) by default. If you want to capture those trace messages to a file, you will need to create a TraceListener and add it to the Debug Listener collection.
TextWriterTraceListener myTrace = new TextWriterTraceListener(File.CreateText(@"c:\Output.txt"));
Debug.Listeners.Add(myTrace);
|
|
|
|
|
Hello
I have the following problem. When I start my program I create an OleDbConnection to a DB2 and use this connection for different requests. But after about 8 minutes I get the following error: "OleDbException System.Data.OleDb.OleDbException: [DB2/6000] SQL0551N "xxx" does not have the privilege to perform operation "EXECUTE" on object "NULLID.yyy". SQLSTATE=42501". What does that mean???
Thanks for your help.
Greets
pkoeppe
|
|
|
|
|
For a work around I open a new connection for each request and close the connection after the request. But here the connection seems not to be closed really. The connection state is closed but the database says there is still a connection. After some request I get the error "Open Connection failed System.Data.OleDb.OleDbException: SQL1226N The maximum number of client connections are already started. SQLSTATE=57030". I don't unterstand this, I close each connection after the request. When I close my program then the connections are closed "really", what is the problem???
That's the way I do my requests:
public DataTable Request()<br />
{<br />
try<br />
{<br />
using (OleDbConnection connection = new OleDbConnection(Constants.DB2_CONNECTION_STRING))<br />
{<br />
using (OleDbDataAdapter da = new OleDbDataAdapter(request, connection))<br />
{<br />
using (DataTable dtResult = new DataTable())<br />
{<br />
da.Fill(dtResult);<br />
return dtResult;<br />
}<br />
}<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.ToString());<br />
}<br />
return null;<br />
}<br />
|
|
|
|
|
hi i have a stored procedure which return the value of user name and i want to populate the ComboBox whit the written value how i do that
wasim khan
|
|
|
|