|
For example:
private void SomeForm_Load(object sender, EventArgs e)
{
string cifTime = timeCIF.Text;
string chkCIF = "N";
emailBody.Text = "Example\nCIF = " + chkCIF + "\nTIME = " + timeCIF.Text;
}
private void SomeBtn_Click(object sender, EventArgs e)
{
string[] sLines = emailBody.Lines;
sLines[1] = emailBody.Lines[1].Remove(6, 1).Insert(6, "Y");
emailBody.Lines = sLines;
}
|
|
|
|
|
Why not keep all the individual pieces of text as separate variables and then rebuild the RichTextBox [^] using its methods, whenever an item changes? This should make it much easier to add or remove specific items in the future.
Use the best guess
|
|
|
|
|
|
Thanks.
Use the best guess
|
|
|
|
|
i want to display a graph,i related it to my database "powerdb" it has a table called powertable with 2 attributes: "power" and "time",but when i run it,nothing appeares. only a white window.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
powerdbDataSet db = new powerdbDataSet();
private void Form1_Load(object sender, EventArgs e)
{
this.powertableTableAdapter.Fill(this.powerdbDataSet.powertable);
chart1.Series[0].XValueMember = "time";
chart1.Series[0].YValueMembers ="power";
powertableBindingSource.DataSource = db.powertable;
}
private void chart1_Click(object sender, EventArgs e)
{
}
}
}
Thank you for your help.
|
|
|
|
|
Hi,
you are not filling the data into your db variable:
this.powertableTableAdapter.Fill(this.powerdbDataSet.powertable);
this line should be
this.powertableTableAdapter.Fill(tdb.powertable);
Regadrs
Jegan
Think! Don't write a line of code unless you absolutely need to.
|
|
|
|
|
thank you very much ,now it works perfectly
|
|
|
|
|
Hey guys, I am trying to create a matrix which allows a user to either turn a square on or off by clicking it. It needs to be 6X8 squares. So far all I can think of is creating 48 buttons, or maybe even a panel split into 48 sections? I am looking for a solution that is not too complex, so any advice on how to do start this would be much appreciated!
Thank you!
|
|
|
|
|
The answer will depend on which User Interface system you are using: Windows Forms or WPF (or web based...).
|
|
|
|
|
I am using Windows Forms!
Thanks!
|
|
|
|
|
Override panel and override the mouse click and mouse move event and OnPaint event. An array of buttons is simpler but you will be happier with results the other way. Neither Windows Forms nor WPF likes a lot of controls and the correct answer a lot of times is custom controls. With such a simple case you will have the opportunity to learn a valuable tool to put in your toolbox.
|
|
|
|
|
Thanks for your input and your advice, I appreciate it. I will look into how to do what you suggested, I am new to this kind of thing! Thank you!!!
|
|
|
|
|
I'd make a Panel or Group with Buttons. But that's just me.
|
|
|
|
|
Hi All,
I have created a program which extracts metadata out of a PST. This data has then been stored in a text file.
I am trying to create a set of charts/graphs which will represent the data which I have pulled out. Is it possible using Visual Studio 2010 to create a bar chart for example using variables or by reading specific data which I have written to the text file.
I know that VS 2010 does have the inbuilt chart feature; however, I can't seem to get it to work off values held in a variable (only from databases, a service, an object or SharePoint).
I am new to programming in C# and using Visual Studio so I may be missing something very simple! I have googled for days and have had no light.
Any assistance would be much appreciated.
Many thanks,
Katie.
|
|
|
|
|
Member 9873028 wrote: missing something very simple
Quite possibly.... but we cannot see your code to tell you what you might have missed.
|
|
|
|
|
I mean in general. I am trying to use the visual studio 2010 code generator so no code has been created yet.
Are you aware of using the visual studio chart gen by using a datasource as a set of variables?
Many thanks,
Katie.
|
|
|
|
|
Hi,
I am so confused with the research I have done. Please help me upload a file, a csv file from a certain location to a remote http server? I cannot use the file upload control.
I have tried
1. WebClient class - using the simple UploadFile method. It did not work. Kept coming back with 404 or 405 error.
2. Tried REST call with no luck.
Any simple method to transfer a file from one location to remote http server.
Thank you and much appreciated!
|
|
|
|
|
This sounds like a permissions issue. 405 indicates you aren't allowed access, "Resource not allowed".
|
|
|
|
|
Please don't bump your question, it is considered rude. If people know what the problem is they will help.
|
|
|
|
|
vanikanc wrote: I cannot use the file upload control.
Why? Technical limitation, or specs?
vanikanc wrote: Please help me upload a file, a csv file from a certain location to a remote http server?
Is there an ASP.NET (or PHP) page on the server to which to upload a file? If no, you'll need FTP.
vanikanc wrote: Any simple method to transfer a file from one location to remote http server.
FTP it is. Install a server-app, and you can upload a file by executing a DOS-command. Hard to beat that in terms of simplicity, since it can be tested without writing any code.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I do apologise for "bumping" this question.
Thank you - I will be using a bat file, called from process class to upload this file to the required server!
Thanks again!!
|
|
|
|
|
Hi,
I am using a Trackbar in my C# application. It's from DevExpress but i guess the standard one is the same..
It uses 1 as minimum SmallChange but I want the value to be 1, 1.5, 2, 2.5, 3, 3.5, etc...
How can I do this?
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
If the property is and integer you can't do this directly.
What you can do is multiply by 10: 10, 15,20, 25 etc. but it will interfere with any numeric labels you might have obviously.
|
|
|
|
|
HI All,
I'm trying to set up the Unity block and I'm getting the following error:
"Given assembly name or codebase was invalid"
My setup is as follows:
private void btnUnity_Click(object sender, EventArgs e)
{
IUnityContainer container = new UnityContainer();
var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
section.Configure(container);
var transform = container.Resolve<ILabTest> "AddNewLabTest");
}
The App.Config is:
<unity>
<containers>
<container>
<types>
<type type="Interfaces.ILabTest, Interfaces" mapTo="DTO.LabTest.AddNewLabTest, DTO.LabTest" name="DTO.LabTest"/>
</types>
</container>
</containers>
</unity>
Any help would be appreciated. Thanks!
-- modified 5-Mar-13 8:34am.
|
|
|
|