|
*sigh* buy a book, and work through it. You're never going to learn if you come to these forums without the slightest idea of how to apply the things people tell you.
If you double click on a button in the designer you will create an event for the click. What do you want the class to do ? You can have an instance as a member variable, or create a local instance in that class, and call it.
If you have results from the class and want to show them, the easiest way is a messagebox, otherwise you need to create a new form class. If you do this, unless the operator class instance is a member for some reason, I'd do the operation inside that form, so your event just shows the dialog and the form itself performs the operation and shows the result. Otherwise, I'd pass the result through the constructor.
And again, if you don't know what any of that means, buy a book and work through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
u can create instance of class on button1_click event
operator op = new operator();
and then can access public members and public methods of class operator
by its object op.
rahul
|
|
|
|
|
Hi All,
I am using MDI form, The first 20% of the form am displaying Treeview control and in the rest of the portion am displaying a mdiChild form. The mdiChild form has got few UI controls on which tab order is set.
Now the issues is, when we hit on tab, it revolves within the child form. How can i make it to go to treeview control once the last control on the child form is focus? ie. on being on the last control and hit tab, the focus should go to the treeview.
Any help is highly appreciated.
Thanks in advance for any guidance and suggestion
Regards
Kais
|
|
|
|
|
Hello
In that last control, handle the KeyUp event
private void MyLastControl_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Tab)
MyTreeView.Focus();
}
Regards
|
|
|
|
|
Hi,
When i get data from a device which is attached to my serial port, its cutting it off after like 20 characters.
This is how it would look like:
afsdfagfsdgsdagf
asgdasdfdsafgafa
gasdfasdgadsfsdv
gasdffbzxxcvfads
But i don't want it to cut it off, how can i fix this so it would look like this:
afsdfagfsdgsdagfasgdasdfdsafgafagasdfasdgadsfsdvgasdffbzxxcvfads
Thanks in advance!
|
|
|
|
|
Replace System.Environment.NewLine with an empty string?
string x = stringFromSerialPort;
string modifiedString = x.Replace(Environment.NewLine, "");
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you Senthil,
I'll try that!
|
|
|
|
|
I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.
Babu
|
|
|
|
|
Hello
Handle the CheckedChanged event, then this:
private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)
{
if(MyCheckBox.Checked)
{
MyTextBoxA.Visible = true;
MyTextBoxB.Visible = true;
}
else
{
MyTextBoxA.Visible = false;
MyTextBoxB.Visible = false;
}
}
That's it! So, where is the question now??:->
Regards
-- modified at 7:30 Wednesday 23rd August, 2006
|
|
|
|
|
or even simpler
<br />
private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)<br />
{<br />
MyTextBoxB.Visible = MyTextBoxA.Visible = MyCheckBox.Checked;<br />
}<br />
|
|
|
|
|
Hey!!
I like fancy long codes!
Regards
|
|
|
|
|
I guess telling you to set the Visible property on a textbox wasn't clear enough for you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
I call an external program over the instruction Process.Start (...).
Is there a possibility to modify the header line of the called program . I know the MainWindowHandle etc. but unfortunately i can only pick out and not change the title.
Does somebody have a proposal for my problem?
gitschi
|
|
|
|
|
You can use Win32's SendMessage(hWnd, WM_SETTEXT, 0, Text) through interop.
|
|
|
|
|
Hye,
thanks for your tipp.
I have solved my problem with the following code.
##################################################################
public class Win32
{
[DllImport("user32.dll")]
public static extern int SetWindowText(IntPtr hwnd , string str);
}
Win32.SetWindowText (hwnd,"new Windowtitle....");
##################################################################
|
|
|
|
|
Hi all,
I have added linkbutton to the datagrid in the template column.i have to display particular field of datasource to the lnkbutton text.My code is like this
this is a class file
public class DataGridTempla :System.Web.UI.Page,ITemplate
{
ListItemType templateType;
string columnName;
public DataGridTempla( ListItemType type,string colname)
{
templateType = type;
columnName = colname;
}
public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
LinkButton lb = new LinkButton();
lb.Click+=new EventHandler(lb_Click);
case ListItemType.Item:
lc.Text=columnName;
lc.Text = "Select " + columnName;
lb.CommandName = "EditButton";
lb.Text= "" + columnName + "";
//container.Controls.Add(chkb);
container.Controls.Add(lb);
container.Controls.Add(lc);
}
this is my webform coding
TemplateColumn tc=new TemplateColumn();
tc.ItemTemplate=new DataGridTempla(ListItemType.Item,"BrandId" );
BoundColumn bc=new BoundColumn();
bc.DataField="Brand_Name";
DataGrid1.Columns.AddAt(0,tc);
DataGrid1.Columns.AddAt(1,bc);
DataGrid1.DataBind();
please try this.
sivamyneni
|
|
|
|
|
Siva Myneni wrote: please try this.
Ok, I tried it, now what?
First, as this is related to ASP.NET you might get a better response by posting it to that forum.
Second, try using a template in the the aspx rather creating it in the code-behind
only two letters away from being an asset
|
|
|
|
|
Hi,
In my solution I have a project for the application and the installer project. The installer builds "Applicationname install.msi", and everything works great.
What I would like to do is this:
Simple solution:
Get the installer project to build "applicationname install <versionnumber> <debug|release>.msi" instead of just "applicationname install.msi" which I then have to rename manully afterwards. Is this possible ?
Optimal solution:
Checking files into subversion creates an assemblyinfo.cs with the number 1.0.0.<subversion_revision> or something. I know how to do this. I could also update the "installerprojectfile.vdproj" to reflect this, although this would change the status of the .vdproj file subversion-wise... ah well.. But that would allow me to automatically update the version in the installer - and if I could get that version reflected in the installer filename I would be home safe
Anyway - has anybody a clue regarding the simple solution ? Is it possible at all in the build-in deployment project ?
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
You can change the name by going to the properties of the setup project and changing the Output file name.
You can setup a postbuild event in the insall project to update the filename with version number.
only two letters away from being an asset
|
|
|
|
|
aha... thanks for the answer, Mark.
I have to select the install project and then the properties tab in order to get the list of project properties (right clicking and selecting properties brings up a dialog with nothing relevant). In the list of project properties I can specify a post-build event, which brings up a dialog with these three macros:
$(BuiltOuputPath)
$(Configuration)
$(ProjectDir)
which are, in turn,
c:\...\folder\debug\applicationname.msi
Debug
c:\...\folder\
So I could write something like
rename $(BuiltOuputPath) $(ProjectDir)$(Configuration)\appliactionname <version>.msi
which would expand to
rename c:\...\folder\debug\applicationname.msi c:\...\folder\debug\applicationname <version>.msi
but how do I retrieve the version number here ? If I have to change the post build macro each time I change version I might as well just change the filename manually
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
You have to get a little more creative, think outside teh macro box.
Write a script(WSH) or simple console app that can be called from the post build event which will read the file for version infor and update the msi file name.
only two letters away from being an asset
|
|
|
|
|
I see.. No built in support for this kind of advanced scheme ) Strange that you can't get project properties like version in the macro.
However, no matter how much out of the macro box I think, I still cant see how I can retrieve the project version number from the msi file. Got any ideas for that ?
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
I use singleton pattern to connect to a database and sql sentences , but the string connections read one time from an xml file when i do new SingletonClass().
Is this safe?? cos the string connection that i read, is stored on a private attributte of the singleton class.
and the next times that i want to access to database i dont read the xml with the parameters to the string connection,i use the string var with the string connections.
thanks
God make a perfect team, the rest have foreigners, Athletic Club Bilbao
|
|
|
|
|
Legolas.Bilbao wrote: Is this safe??
Are you worried about the connection string being stored in an xml file on the disk ?
|
|
|
|
|
worried about string connection had stored on memory its a problem or not? maybe its a paranoic question
Dios creo un equipo perfecto a los demas los lleno de extranjeros
|
|
|
|