|
If you do something unsupported, expect issues, else they would have made it available. Personally, I would not supply a custom class name as you have done.
|
|
|
|
|
Hi,
By using the above code which I have mentioned I am able to get the Transparency od the RichTextbox control, but the problem is that the text is not somehow being able to retain on the control.
The text on the Richtextbox suddenly gets disappear when i hover the mouse on the screen.
Can someone help me out on this problem.
Thanks and Regards,
Deb
|
|
|
|
|
Hi,
I am using the following code to get the installed printers on the local machine.
During the loop, when it gets to one of the printers, it throws an error which is invalid parameter. I can not figure out what is wrong.
Error happens on the foreach line.
I do not see any difference between the printer that seems to throw the error and all the other printers.
Any thoughts please?
This is the code:
using System.Management;
...
string strServer = "\\\\" + txtServerName.Text.Trim();
ManagementScope myScope = new ManagementScope(strServer + "\\root\\cimv2");
SelectQuery oQuery = new SelectQuery("SELECT * FROM WIN32_Printer");
ManagementObjectSearcher oResults = new ManagementObjectSearcher(myScope, oQuery);
//Iterate through printers...
foreach (ManagementObject oItem in oResults.Get())
{
string strPrinterName = oItem.Properties["DeviceID"].Value.ToString();
}
|
|
|
|
|
I am developing a rent a car software. The customer is limited to 150mile daily and he should pay US35 for every 10miles extra.
How can I calculate that on the day customer returns the vehicle?
|
|
|
|
|
This is C# form and not a primary school maths class
jrahma wrote: How can I calculate that on the day customer returns the vehicle?
float LfExtraMilage = (LfEndMilage - LfStartMilage) - (150 * (LiNumberOfDays + 1));
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
float distance = 215;
float overhead = distance - 150;
if(overhead > 0)
{
float extraMiles = (int)(overhead / 10) + Math.Sign(overhead % 10);
float price = 35 * extraMiles;
}
This assumes 35$ for each 10 miles and another 35$ for each new incomplete ten miles started.
By the way, this is really like 5th grade maths
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
var fee = Math.Max(mileage - 150,0) * 35;
|
|
|
|
|
jrahma wrote: I am developing a rent a car software.
Well, judging by this and your previous post I hope your client has low expectations and a lot of time allocated for testing.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am developing a rent a car software and if the customer didn't return the car on the time as per the contract then he has to pay US10 for every one hour after the agreed time.
how can i calculate how many (one hours) he has to pay?
|
|
|
|
|
jrahma wrote: how can i calculate how many (one hours) he has to pay?
This is no programming question.
You better have a look at RentACoder[^]
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 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.
|
|
|
|