|
dr_iton wrote: Do I need to create a new method to reload the text file again or what ever. Not necessarily, but you do need to create a method that can add any extra information as it is entered into the program. These controls can be updated at any time by adding or removing entries from them, you do not need to reload them from the beginning.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
After all I have the following problem.
I can remove the lines from listbox, but those lines are not deleted from text file, how to delete a specific line from a text file.
Cheers in advance for your reply.
|
|
|
|
|
dr_iton wrote: I can remove the lines from listbox, but those lines are not deleted from text file Why would you expect them to be, since there is no connection between the two?
The easiest solution would be to recreate the text file from the contents of the ListBox , either when the content changes, or when the program terminates.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I created a method to show the items in ListBox in Form 1, like this
string linjaListBox = this.ListBox.SelectedItem.ToString();
string emriPjesa = linjaListBox.Split('\t')[0];
string mbiemriPjesa = linjaListBox.Split('\t')[1];
string datelindjaPjesa = linjaListBox.Split('\t')[2];
string vendlindjaPjesa = linjaListBox.Split('\t')[3];
string xhirollogariaPjesa = linjaListBox.Split('\t')[4];
this.emriBox.Text = emriPjesa;
this.mbiemriBox.Text = mbiemriPjesa;
this.datelindjaBox.Text = datelindjaPjesa;
this.vendlindjaBox.Text = vendlindjaPjesa;
this.xhirollogariaBox.Text = xhirollogariaPjesa;
indeksLista = Convert.ToInt32(ListBox.SelectedIndex.ToString());
In the next form I used three of TextBoxes from first Form such as emriBox,mbiemriBox and xhirollogariaBox.
How to show the text in those three TextBoxes in form2 if I select a row in ListBox from Form1.
|
|
|
|
|
Why not just:
string linjaListBox = this.ListBox.SelectedItem.ToString();
string[] items = linjaListBox.Split('\t');
this.emriBox.Text = items[0];
this.mbiemriBox.Text = items[1];
this.datelindjaBox.Text = items[2];
this.vendlindjaBox.Text = items[3];
this.xhirollogariaBox.Text = items[04];
indeksLista = ListBox.SelectedIndex;
Form2.emriBox.Text = items[0];
Form2.mbiemriBox.Text = items[1];
Form2.xhirollogariaBox.Text = items[4];
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
OK, my Form2 is named GjendjaForm, and after I rename Form2 with GjendjaForm it shows me the following errors.
GjendjaForm.emriBox is inaccessible due to its protection level
GjendjaForm.mbiemriBox is inaccessible due to its protection level
GjendjaForm.xhirollogariaBox is inaccessible due to its protection level
also it says that:
Error 3 An object reference is required for the non-static field, method, or property 'LlogariaBankare.GjendjaForm.mbiemriBox' C:\Users\Driton Gashi\Documents\Visual Studio 2008\Projects\LlogariaBankare\LlogariaBankare\KlientetForm.cs 112 17 LlogariaBankare
|
|
|
|
|
You need to make your textboxes public, or add some properties or delegate events that allow the transfer of data between the two classes. In the second message you are trying to call a non-static method of the class without an object reference. This is basic C# object handling which you really need to understand before you go much further in this development project. Take a look at these samples[^] for further details.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I am displaying a datagridview using
dataGridView1.DataSource = dv;
When the dgv is displayed only the top left cell has a visible value. However when I click in other cells, the data in that cells becomes visible.
Any ideas why this could be happening. Thanks.
|
|
|
|
|
1)Do use change any other properties of your dgv ?
2) What type is the "dv" that you set as DataSource?
Although I work with dgvs I never had this bug.
|
|
|
|
|
1) No, I just placed the dgv on the form, but changed no properties.
2) dv is a dataview. I have changed changing the source to a datatable and the same thing happens.
I have tried using my code in a new project, and it works fine.
|
|
|
|
|
May be silly, but since it works on a new project, try to use "rebuild solution" in your visual studio.
Other than that I have no clue.
|
|
|
|
|
I tried that and it didn't work. I just don't understand why only the selected cells become visible I put a lot of work into the form and I'd prefer not to do it all again, so if anyone has any ideas - please let me know! Thanks.
|
|
|
|
|
just delete control from the form and try to add with same name to preserve the coding done on the variable. VS behaves odd at times. when this happens i used to close all the visual studio and start over again. will work like a charm.
Jibesh.V.P
India
|
|
|
|
|
Good idea. I deleted the dgv, saved and closed Visual Studio. I re-opened it, added a new dgv, and the same problem exists. Very strange...
|
|
|
|
|
what are all the dgv events you subscribed for? just trying out all the possibilities? in normal case it should work. mght be there is some code running behind creating this odds
Jibesh.V.P
India
|
|
|
|
|
All I do is create the dgv, and call it by button click using
dataGridView1.DataSource = dv;
There are no dgv events, such as click, etc.
|
|
|
|
|
Hi
try debugging the gridview. In rowdatabound event, see the visibility of the columns. This may give some clue how.
Naina
Naina
|
|
|
|
|
From what I've read there is no RowDataBoundfor dgv in Windows Forms Apps, although I could be wrong. I did add a watch to the dgv, and everything looks normal...
|
|
|
|
|
I figured it out! I had the dgv font color set to white! So the text didn't show up against the background unless it was highlighted...
Thanks to everyone that helped!
|
|
|
|
|
Oh man. see we keep asking and you said didnt do anything.. arhh!!!! nauty boy.. have a
good luck
Jibesh.V.P
India
|
|
|
|
|
I didn't. I have other controls with white text, so white must be set as a default color somehow for new controls.
Thanks again though. Great help from all! I'll enjoy my !
|
|
|
|
|
Hi dear friend. i am try to develop intelligent character recognition (icr) software using c# windows application. but not success ICR software. please help me dear friends
|
|
|
|
|
Rameshkannabravo wrote: intelligent character recognition (icr) software using c# windows application
Any character recognition routine should be in a library and completely separate from any particular application.
|
|
|
|
|
See here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i have more than 55000 Customer and i wanna Fill Combobox with this customers quick .. there is any way
to load form quickly and to enter Combobox quickly
** i use background worker but this hang my form and my app is run slowly can i use threading and how
i want solutin plz
private void backWork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
{
}
else
{
FillComboBox();
cmb3ameelname.Focus();
Loadform = true;
cmb3ameelname.SelectedItem = null;
cmbLandTele.SelectedItem = null;
}
}
private void backWork_DoWork(object sender, DoWorkEventArgs e)
{
CusLis = CustomerManger.SelectCustomersAll();
}
void FillComboBox()
{
cmbameelname.DataSource = CusLis;
cmbameelname.DisplayMember = "CustName";
cmbameelname.ValueMember = "CustId";
}
frm_load()
{
this.backWork.DoWork += new DoWorkEventHandler(this.backWork_DoWork);
this.backWork.RunWorkerCompleted+=new RunWorkerCompletedEventHandler(this.backWork_RunWorkerCompleted);
this.backWork.RunWorkerAsync();
}
|
|
|
|