|
If you want to use valid login name on another form after user authentication the you can create a public property on your another form and fill it with the value by accessing it before opening that form.
Ex:--> if you are on "login.cs" and want to open "Admin.cs" then code for admin will have a public property say "UserNo"
Private int userNo;
Public property int UserNo
{
get { return userNo;}
set { userNo = value;}
}
Now on login.cs after user validation
Admin admin = new Admin() (( This depends opn your architecture))
admin.UserNo = login;
admin.ShowDialog();
This way the user no will be available as per code optimization also.
vims
|
|
|
|
|
I have a windows form in C# with some text boxes and a botton control.
I wanted a code piece to guide me to feed an excel sheet from a text box over a button click. To elaborate it, the contents of a text box should go to a particular cell of the Excel work sheet on button click.
A reference to an article that may solve the problem will also do.
Thanks,
Sid
|
|
|
|
|
Hello to everyone. I've a window form application in c++ and i've a button in it.
How can i add the properties that when the mouse is over the control a description of the control is shown?
Thanks for answers regards.
|
|
|
|
|
Catch the MouseOver event
|
|
|
|
|
Hi, thanks for answer.
I'know there's the event onmousehover but i think what i want is different.
when you are on a button,(like start button of windows xp) a yellow rectangle with a help description is shown. How can i do this?
Thanks , regards
|
|
|
|
|
dodoxor wrote: when you are on a button,(like start button of windows xp) a yellow rectangle with a help description is shown. How can i do this?
This piece of code should do for you :
private void startButton_MouseHover(object sender, System.EventArgs e)<br />
{<br />
startButton.BackColor = Color.Yellow;<br />
ToolTip toolTip = new ToolTip();<br />
toolTip.ShowAlways = true;<br />
toolTip.SetToolTip(startButton, "Whatever Message...");<br />
<br />
}
|
|
|
|
|
Thanks a lot is working. I 've also tried to put
ToolTip toolTip = new ToolTip();
toolTip.ShowAlways = true;
toolTip.SetToolTip(startButton, "Whatever Message...");
in the Form_load event and is work too.
Thanks, bye.
|
|
|
|
|
Set tooltip property at design time , if the button is created dynamically then user code to set tooltip property
|
|
|
|
|
Hi,
I have a windows forms app that contains a datagridview, with two filtered columns, some textbox columns, and a checkbox column. The filtering on the dgv is accomplished by using dropdowns on the column headers of the two filterable headers and this happens reasonably quickly.
My problem comes when I try to set the value of all the checkboxes to either checked or not checked. If I have a small number of rows in the dgv then each check operation takes about .0015 of a second. If I have a large number of rows that time jumps to 1.5 seconds per row. When I use the filters the dgv updates in about 2 seconds. I am at a loss.
The code I use to update the dgv checkbox column is:
<br />
If btnSelectRecords.Text = FormConstants.ControlConstants.DESELECT_ALL_RECORDS Then<br />
For Each row As DataGridViewRow In dgvLoanRecords.Rows<br />
row.Cells(FormConstants.GridViewConstants.SELECTED).Value = False<br />
Next<br />
btnSelectRecords.Text = FormConstants.ControlConstants.SELECT_ALL_RECORDS<br />
Else<br />
For Each row As DataGridViewRow In dgvLoanRecords.Rows<br />
row.Cells(FormConstants.GridViewConstants.SELECTED).Value = True<br />
Next<br />
btnSelectRecords.Text = FormConstants.ControlConstants.DESELECT_ALL_RECORDS<br />
End If<br />
Can someone point me in the right direction to speed this process up.
Thanks
Jim
|
|
|
|
|
I currently have a single threaded application that contains a
strongly typed dataset (called dsdataset1) with 3 tables, all bound to
comboboxes on my main form.
This works in its current form (the datasets are filled on the form
load event).
I noticed a problem whereas the form doesn't draw until the datasets
are filled, so I figured I'd use the background worker component to do
the dataset filling on a seperate thread.
For some reason, I cannot get this to work properly. My program
loads, and my dataset is filled, however my comboboxes are no longer
bound to the dataset. It's driving me nuts.
I've tried passing the dataset back out during the runworkercompleted
event (i.e. dsdataset1 = ctype(e.result, dataset)), but even that
doesn't work. I even tried resetting the bindingsource.datasource for
my combobox back to the dataset after passing the dataset out, but no
go. I'm at a loss.
Any suggestions?
|
|
|
|
|
Hi,
i have serious problems to print a Windows Form with some Textboxes...
The printing should work in background...
I really can't find a working solution.. so please help me!!!
' that form with textbox controls
Dim rForm As MyForm = New MyForm ()
' image to save / or to print
formImage = New Bitmap(rForm.Width, rForm.Height)
Dim rec As New Rectangle(0, 0, formImage.Width, formImage.Height)
'print the form
rForm.DrawToBitmap(formImage, rec)
'save as image
formImage.Save("d:\screen.bmp")
The code can be on c# or vb.net!!!
Thank's for your answers!!!
|
|
|
|
|
|
Hi to everyone.In my visual c++ window form appplication, i want to open a directory (of images) and see the images in a picturebox.
I know that i can use folderborwserdialog to select the directory but when i've the path selected in the folderbrowserdialog how can i use the files in it? Have i to pass something to an imagelist??
Thanks for answers, bye .
|
|
|
|
|
Where do you want to show those images? If you have another form for images then you can retrieve all the images from the folder path you got using folderbrowsedialog
|
|
|
|
|
I've a solution...(take the directory name and gets the files in it).
String^ folderName;
array <string^>^ files;
System::Windows::Forms::DialogResult result = folderBrowserDialog1->ShowDialog();
if ( result == ::DialogResult::OK )
{
folderName = folderBrowserDialog1->SelectedPath;
}
files=System::IO::Directory::GetFiles(folderName);
if(files->Length!=0)
for(int i=0;i<files->Length;i++)
{
FileInfo^ fi = gcnew FileInfo(files[i]);
if(fi->Extension==".jpeg" || fi->Extension==".bmp"||fi->Extension==".jpg")
{
Bitmap^ cap=gcnew Bitmap(fi->FullName);
this->capture_img_box->Image=cap;
System::Threading::Thread::Sleep(1000);
this->Refresh();
Application::DoEvents();
}
}
Thanks however for the answers.
Bye.
|
|
|
|
|
how change specific row back color in DataGrid?
i have a DataGrid with some rows, how change row back color, like set row 1 with back color is red, row 2 is blue, row 3 is yellow
thanks
|
|
|
|
|
What infomation are you showing
like a report
|
|
|
|
|
no, i only want change specific row back color, and i want know how to do that ?
thanks
|
|
|
|
|
I don't think you can do that in Windows Forms.
|
|
|
|
|
i think can be done, but i don't know how?
like properties BackColor of DataGrid, it change bg color of odd number row
|
|
|
|
|
I was just wondering because datagrid does not have a Row(s) property.
|
|
|
|
|
Sorry a bit of a late reply but hopefully this will still help you.
You can set a rows color using the following line:
dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Blue;
(where 'i' is the current row as i am assuming you will have a loop so you can set the color depending on the row index).
You can also set the default row and cell styles using the properties window however this will apply to every cell and row.
|
|
|
|
|
Hello All,
Please help me solve this problem. I want to create an editor/designer that will handle the following situation.
I have an abstract class Marker, and many different implementations that will not be exposed to the user.
The markers are created through a factory system, MarkerFactory, and I have a collection
of the markers in a Control that I will to create the editor/designer for.
<br />
public class Marker<br />
{<br />
protected Marker(...){}<br />
} <br />
<br />
internal class AMarker : Marker<br />
{<br />
} <br />
<br />
internal class BMarker : Marker<br />
{<br />
} <br />
<br />
public class MarkerFactory<br />
{<br />
public Marker Create(...) {return newMarker;}<br />
}<br />
<br />
public class MarkerControl : Control<br />
{<br />
[MarkerDesigner]<br />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]<br />
public IList<Marker> Markers<br />
{<br />
get{ return markerList;}<br />
}<br />
} <br />
Any guide/hint as to how I could create such an UITypeEditor, that will work with the
factory system.
Best regards,
Paul.
-- modified at 10:40 Monday 18th June, 2007
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Please don't cross post in multiple forums.
|
|
|
|
|
I thought I saw this question earlier in another forum :->
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|