Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am Creating an app with C#. I have a ListView on the Main Form(FormM) which lists all the record, i can select on record and edit it in the new form(FormC). Now I want to have a Navigator on the Main Form. Suppose that the FormC is open and showing a record for edit. in That case i want that if i click the navigate button on the Main Form, the value on the FormC changes according the next or previous move of navigation.
the Navigation buttons is in the FormC in any samples that i found in internet. but i want those be separated.
any sample or idea is appreciated.
In your FormM, make the listview a static member, to do this, go to FormM.Designer.cs, locate the declaration of listview and change it to public static type from private type. After you do this, plenty of errors will be reported in the same file. To fix those, replace all this.listview with only listview.
The above configuration will make your listview accessible from any other form. To access the listview from FormC, user FormM.listview.
Similarly change the Text box/area from FormC to public static. This will make the textbox accessible from FormM.
When you press next and previous buttons, change the selection controls between items and in the SelectedItemChanged action function, put the code to send the selected item to FormC's text box.
Eg: FormC.textbox1.text = {your code to fetch the selected item}
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have aspx page.having an issue is that if we select first time option from drop down value gets appears on the page.but when we select second time option from drop down still previous data getting appears. how do i clear all the previous data after drop-down SelectedIndexChanged Event..?
As you have not provided the code when i'm writing this answer. In Asp.net u can achieve this by using jquery. I'm using club dropdown list with ID clubs as an example. This event will bind to the list and will keep on updating selected variable when the selectedIndex change. Then you can simply pass the selected variable value to lets say a span element with id spanClub
$(document).ready(() => {
$('#Clubs').change(() => {
let selected = $('#Clubs :selected').text();
$('#spanClub').text(selected);
});
});
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
In my application I am trying to hide the values in my drop down list while it carries out the required functionality. As shown below you can see the drop down showing a value. The values are being pulled from a database.
When selected it would show the values below:
I would prefer if the values are not shown. Meaning I would want the dropdown values to not be shown but still carry out the fill operation as shown above.
So to explain more clearly, My comboBox which contains the value "123456789" would pass the values "P10434" and "Jev Pharma" to the respective textBoxes below respectively.Instead of showing my dropdown values while typing(auto suggest currently does this) I would instead want the dropdown list to not suggest any values at all. Meaning once I type "1234567..." it would not show any values int he comboBox but rather accept the info being typed in and pass the corresponding values from the database to the texboxes below.
I have tried changing the properties of the comboBox by removing append and suggest but the functionality is different. It no longer fills the data but instead just allows typing of a value. I am not sure how to approach this. Any suggestions?
Set the properties as follows:
comboBox1.AutoCompleteMode = AutoCompleteMode.Append;
comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
comboBox1.DropDownStyle = ComboBoxStyle.DropDown;
This will append the suggestions when typing without showing the list.
You can handle the appropriate event per your requirement to fill your textboxes.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have a material form with 3 buttons (back, stock, bom), when i click bom button it will display bom form that has a grid inside. double clicking on a row in the grid will load the material form (previously loaded) but containing the information of the clicked row (material->bom->material) my problem is on the second load of the material form the 3 buttons are not clickable(nothing happens clicking on these buttons) but the displayed info is already correct. So my question is how do i activate the buttons ? (buttons are of type Resco.Controls.OutlookControls.ImageButton)
My best bet, with the information you provided, is that you call ShowDialog() on the grid form, which disables the material form. You can then only reactivate the material form by closing the grid form.
You could create a new instance of the material form, and display the new information on that, so when you close both that and the grid form, the original material form will be activated with its original content.
Be careful though, an application that allows users to "spam forms" like that can get very complex, both for you and the end user.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have a requirement to show a list of details in a ToolTip. Is this possible to do? I tried setting a Dictionary to a Tooltip in the code behind. It just displayed Collection.?? Kindly help
You can display anything you choose in a tooltip (WPF is nice like that - you can template anything). However, when you set a Dictionary to the tooltip value, it doesn't know what you want to do with it and defaults to a useless string of text.
Try setting a template for your tooltip that would render the dictionary in a useful way. Since ToolTip is a ContentControl, it will work this out for itself if there's a suitable template available (either keyed by type, or set within the ToolTip).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Here I want data to be displayed inside a message box in a table as shown below and that message box should be activated on click. How to do that?
Yes you can show data from a table but I think you will be best of creating a new form and using ShowDialog() then you can use any control as you desire. Visit this link, it will help you:
Link
I did not get why are you using message box only .You can use a new windows form to do the same task which will be very much easy to implement and you can customize that one based on you requirement .
To create a new window form you just need to pass the reference of the first form to other .
lets say that you have two forms parent and child.
then in child constructor define it as following:
public child(parent parentref);
and then from parent code just create a object like
child childobj=new child(this)
Hope this will work