|
Hi ! I am designing a simple calculator application and I am having trouble coding the backspace button. I store the data that the user had input in a string by the name of strInput with initial value strInput = "" .
I display the value that the user had clicked by coding :
lblDisplayPanel.Text+="value of button";
For example, lets take a look at my button 1
private void btn1_Click(object sender, EventArgs e)
{
lblDisplayPanel.Text += "1";
}
so when I click button 1 thrice, the display panel will show "111". However, I only know how to add values to the display panel label. I tried -= but it wont work .
The backspace button is supposed to remove the last value entered by the user but how do I do that ?
|
|
|
|
|
Try the following in your back space button click event
private void btnBS_Click(object sender, EventArgs e)
{
lblDisplayPanel.Text = lblDisplayPanel.Text.Remove(lblDisplayPanel.Text.Lemgth - 1);
}
|
|
|
|
|
Thanks. I read the description of the remove method from the intellisense and it explains alot.
|
|
|
|
|
Lim Yuxuan wrote: The backspace button is supposed to remove the last value entered by the user but how do I do that ?
lblDisplayPanel.Text = lblDisplayPanel.Text.Remove(lblDisplayPanel.Text.Length - 1, 1);
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks. I have read the description of the remove method from the intellisense and it explains alot.
|
|
|
|
|
Hi.
I'm building an application in winform environment that have a Tabcontrol in it.
That tabcontrol should have multiple lines in it.This can be done by setting the multiline property in the control.
But what i have trouble in is ordering the tabpaged in the control in a custom order.
for example , i want the first row to have 4 tabpages, second row 10 tabpages and so on....
can i accomplish that task without altering the tabpages width that causes
the tabpages to slide off to the next row?
thanks
|
|
|
|
|
I have this code written to create a button at runtime, inspite of setting the text assign , the text is not visible on the button. Please help me.
DataGridViewButtonColumn objAssign;
objAssign = new DataGridViewButtonColumn();
objAssign.Name = "Assign";
objAssign.Text = "Assign";
objAssign.HeaderText = "Assign";
objAssign.ToolTipText = "Click to Assign";
dtgAssignIssues.Columns.Add(objAssign);
Then, I tried looping through the buttons using the following code, it sets the text for the button only if there is one row. could u plz help me for multiple rows.
DataGridViewButtonColumn objAssign;
objAssign = new DataGridViewButtonColumn();
objAssign.HeaderText = "Assign";
objAssign.Name = "Assign";
dtgAssignIssues.Columns.Add(objAssign);
//dtgAssignIssues.Columns[1].ReadOnly = false;
foreach (DataGridViewRow r in dtgAssignIssues.Rows)
{
//MessageBox.Show(objAssign.Index.ToString());
DataGridViewButtonCell b;
b = (DataGridViewButtonCell)r.Cells["Assign"];
b.Value = "Assign";
}
|
|
|
|
|
The above problem works if the form is not an MDI Child, But if its an MDI child this doesnt work.
|
|
|
|
|
I want to create a setup in which while installing,I can execute my own code with the UI.....I dont want to install my application rather want to install its output.....plz help me out...
|
|
|
|
|
1, Go to file menu > click Add > new project >now “Add New Project” Dialog appear.
2.Select “Other Project Types” and click “Setup and Deployment” projects,Choose “Setup Project”give name project name in name text box finally click OK.
3.New project appear in solution explorer,for example you give the name “MyEXE”..it will display with this name.
4.right click the MyEXE > go View > click “File System”
5.You can see the “File System on TargetMachine”under three folders
Application Folder
User’s Desktop
User’s Program Menu
6.Select Application Folder and right click Add>Project Output>select Primary output
7. select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE
next >>
next >>
8.If you want to change the Manufactures name for exe,just right click the project go to properties
change the properties as per you requirement
9.Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)
EXE available @ this location
When you want to install the EXE on the client machine,you should be installed .NET Framework on that mc because,Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs.
|
|
|
|
|
Can any one make .exe for web applications????
or
any another way......
|
|
|
|
|
I hope this is what you're looking for ClickOnce[^].
Eslam Afifi
|
|
|
|
|
Below is my datalist it is inside a gridview .Now i want to caluculate the total giftcost and print it in lbltotal it is there in footer template ?
<asp:datalist id="dl1" runat="server" onitemdatabound="OrdersItemBound" xmlns:asp="#unknown">
<itemtemplate>
<table>
<tr>
<td> <font face="Arial" size="1"> <%#DataBinder.Eval(Container.DataItem, "giftprodid")%> -$</font></td>
<td><font face="Arial" size="1"><![CDATA[<%# DataBinder.Eval(Container.DataItem, "giftcost", "{0 .##}")%>]]>(</font></td>
<td><font face="Arial" size="1"><![CDATA[<%# DataBinder.Eval(Container.DataItem, "giftqty")%>]]> )= $</font></td>
<td align="right"><font face="Arial" size="1"><![CDATA[<%# DataBinder.Eval(Container.DataItem, "giftcost", "{0 .##}")%>]]></font></td></tr>
</table>
</itemtemplate>
<footertemplate>
<tr>
<td>
<p align="right"> <font face="Arial" size="1">Total = </font> <font color="green" face="Arial" size="1"><b>$<asp:label id="Label1" runat="server" text="fgfg"></asp:label></b></font></p>
</td>
</tr>
<tr>
<td>
<p align="right"><font face="Arial" size="1" color="red">Shipping = </font><font color="green" face="Arial" size="1"><b><asp:label id="lblshipping" runat="server" text="56"></asp:label></b></font></p>
</td>
</tr>
<tr>
<td>
<p align="right"> <font face="Arial" size="1">GradTotal = </font> <font color="green" face="Arial" size="1"><b>$<asp:label id="lbltotal" runat="server"></asp:label></b></font>
</p>
</td>
</tr>
</footertemplate>
</asp:datalist>
example:
CAKSPL137 -$ 22.99( 1 )= $ 22.99
TGKHWGM102 -$ 18.99( 1 )= $ 18.99
Total = $41.99
<div class="ForumMod">modified on Friday, September 12, 2008 2:12 AM</div>
|
|
|
|
|
This is not ASP.Net forum.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
Hi,
I am trying to consume a java web service in c#(windows forms client not asp.net client). The wsdl file opens in inernet explorer correctly (here also I have to give my usename and password i.e. an authenctication window opens and I enter my userame and password.)
But If I try to add a web reference to the service or try to create a proxy via wsdl tool I get the "The request failed with HTTP Status 401:Unauthorized" error. I tried by supplying username,password and the domain attributes with the wsdl command, but to no use. THe WSDL coomand I am using is as follows :
wsdl /out:myproxy.cs /username:nekuma2 /password:abc123 /domain:insidelive http://tkydte3pc40441:8080/fitsl/services/SimpleFixedIncomeTokyoService?wsdl
I have been breaking my head over this for a long time. Any help would be greatly appreciated.
Regards,
Neeraj
|
|
|
|
|
Ask this in the correct forum.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
So what will be the correct forum for this?
|
|
|
|
|
"Java web service" means "Java". We have a whole freakin sub-site for java. If he doesn't want to go that far, he can try the web development form.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: "Java web service" means "Java". We have a whole freakin sub-site for java.
Seriously, did you even read the question? He is accessing a java webservice from a C# client. A perfectly valid C# question. Not even web related.
|
|
|
|
|
newbieNeeraj wrote: /domain:insidelive
I think that will force NTLM (?) authentication, try without it.
|
|
|
|
|
Hi Leppie,
I tried without domain and it worked. Thanks for the suggestion. Though I still don't know what is NTLM authentication ( guess i'll need to read it up). SOrry for the late reply. But I didn't have access to the code at home.
Thanks again.
|
|
|
|
|
I have an MDI form and multiple child forms... If i place any controls like label, buttons or textboxes on MDI form, These controls are visible even on the child form, how do i prevent this from happening.
|
|
|
|
|
Typically, controls aren't placed on the main form in a MDI application (except maybe a MenuStrip or StatusStrip ).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
if you have to visible that controls only when no child forms show, you can use SendToBack for that controls when child form show and assign event FormClosed for child forms to call BringToFront to show that controls again
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|