|
I recently answered a question with a similar problem involving sorting TreeNodes: [^]. Quote: A more complex way to deal with this is to use a 'SortedDictionary with a custom Comparer: the example shown here exploits the fact that numeric character sequences not at the end of the string are sorted in the order you want; only when the numeric characters are at the start of the string, do you need to compare in "reverse." You could adapt the code shown there to meet your needs.
cheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
I have enabled your app from this page to automatically install it, but no snapshots can be found and no images of it. Can you install the program with your installation?
page Smaple : Silent Install Mode | General Information | DevExpress Help[^]
Sample Code C# :
D:\Fd\DevExpressUniversal2019.exe /Q /EMAIL:dxcustomer@example.com /PASSWORD:MyPassword /EULA:accept
|
|
|
|
|
Member 14046363 wrote: have enabled your app from this page What app and what page are you talking about? Your only reference points to the devexpress website.
|
|
|
|
|
We are not devexpress, nor are we their support department.
Go to the DevExpress site, login with your registration information, and try their support. They will know a lot more about their own product than we would!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You purchased expensive software from a company with a good reputation for support. Use their support.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
I got help with installing the app from this page automatically(<a href="https://documentation.devexpress.com/GeneralInformation/15656/Installation/Install-DevExpress-NET-Products/Silent-Install-Mode">Silent Install Mode | General Information | DevExpress Help</a>[<a href="https://documentation.devexpress.com/GeneralInformation/15656/Installation/Install-DevExpress-NET-Products/Silent-Install-Mode" target="_blank" title="New Window">^</a>]), but I didn't get any feedback and no errors. And the app didn't install Can you guide me on what to do to install the app automatically?
Sample Code C# :
D:\Fd\DevExpressUniversal2019.exe /Q /EMAIL:dxcustomer@example.com /PASSWORD:MyPassword /EULA:accept
|
|
|
|
|
Go to the DevExpress site and log in. Click on Support in the menu bar and you can open your own support ticket for problems like this.
|
|
|
|
|
Thanks for your reply but I did the same before, but did not receive any response
|
|
|
|
|
Did you verify the email account you supplied is the one used to login to the DevExpress site?
Is the password for that account specified correctly (case MATTERS!)?
Did you run that command line without the /Q switch to verify it installs?
The only thing I can think of that would stop the installation would be the email/password wasn't valid, or has expired.
|
|
|
|
|
Thanks for your cooperation friends. But I find myself sharing the reason that other friends, if they can find this problem, can use grammar code in this way (or in your program). Saman from Iran
Code Sample is c# :
D:\Fd\DevExpressUniversal2019.exe /Q /EULA:accept /DEBUG
Test Full :Devexpress 2019.1.5
|
|
|
|
|
I am writing a standard WinForm-application in C# using Visual Studio Express 2005. I have a ComboBox that shows certain com ports on my system that can be used to communicate with different embedded products. When USB-to-serial-cables are plugged in or disconnected, I need to update the contents of my ComboBox. I found excellent source code to get events when USB-cables are connected/disconnected: DiskImager/DriveDetector.cs at master · DynamicDevices/DiskImager · GitHub[^]. My problem is that sometimes I want to disable my events temporarily and then shortly thereafter enable them again. In case there was an event during this short period of time, I would like to generate an event retroactively. I think it would be appropriate to generate that event in the same thread as the regular events, that is, the WndProc(ref Message m) thread. So, how do I software-trigger WndProc(ref Message m) to execute?
|
|
|
|
|
|
Thank you, your link helped a lot. The following works great:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
IntPtr windowHandle = IntPtr.Zero;
if (this.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate
{
windowHandle = this.Handle;
});
}
else
{
windowHandle = this.Handle;
}
SendMessage(windowHandle, DBT_DEVNODES_CHANGED, IntPtr.Zero, IntPtr.Zero);
|
|
|
|
|
Easy (sort of) when you know how. Good luck with the rest of your work.
|
|
|
|
|
note that the github code the OP is using defines a WndProc to get the events.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
the github code you are using now defines a WndProc that begins like this:
{
int devType;
char c;
if (m.Msg == WM_DEVICECHANGE)
{
switch (m.WParam.ToInt32())
{ if you want to suspend/restore intercepting.handling of the events, modify a bool variable
public static bool HandleDeviceChange = true;
public void WndProc(ref Message m)
{
int devType;
char c;
if (HandleDeviceChange && m.Msg == WM_DEVICECHANGE)
{
switch (m.WParam.ToInt32())
{
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
A lot of books deal with the console side of c# more than the form side.
Question.
I have a form that has a start, yes, no button.
When I click on start a question is displayed on the form and the user click on either the yes or the no button.
How do I tell the main program what button has been pressed?
When I say 'main program' I mean the part of the program that's ran when the start button is pressed.
At the start the program YN = 0. If the No button is pressed then YN = 1 and if the Yes button is pressed then YN = 2.
What happens next depends on what button is pressed so I need to get this information but to the main program.
|
|
|
|
|
Brian_TheLion wrote: A lot of books deal with the console side of c# more than the form side.
I'd disagree with that, quite strongly: most "beginner" books start with the Console, because it's a lot easier to get your head round - but quickly move away to WinForms or WPF because that's what gets used in the real world. Certainly, all the Addison Wesley, Wrox, and Microsoft Press books that I've read do!
But it's pretty easy - it all works via Events. When you click the button, it generates an Event called "Click" which the Form (or another container like a UserControl perhaps) handles.
Open your form in the designer.
Double click the button. That will add a Click event handler to the form and open the code window to let you type code into the handler method.
Type your code:
MessageBox.Show("The Yes button was clicked", "My form event handler", MessageBoxButtons.OK, MessageBoxIcon.Information);
And run your app.
Click the button, and the message will appear!
You code will look like this:
private void YesButton_Click(object sender, EventArgs e)
{
MessageBox.Show("The Yes button was clicked", "My form event handler", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Because the system will add the handler method framework for you:
private So that it is only usable inside the form.
void Because it doesn't return a value
YesButton_Click Name of the handler method: YesButton Click event
object sender "sender" is object that raised the event (useful if several buttons share the same handler)
EventArgs e Provides extra information on the event if you need it.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I think what you're asking is how to get the result of the click back to the main form.
When you open the form that has the buttons, use .ShowDialog, rather than just .Show, and the results of the button click (as OrginalGriff showed) can be returned to the calling form easily.
|
|
|
|
|
From what the OP describes, I cannot tell if he is using a separated Form to display the quesstion.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
First, are you using one Form for all this, or more than one Form ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Thanks Bill and RenJerDan for your replies.
To go more into detail.
Once the user has pressed the start button a d the question is displayed to the user then the user has a choice of clicking on the YES or the NO buttons.
For a forms program once the program has displayed the question it is waiting for the user to press a button on the form, but if the user pressed the YES button then control switches to the Yes_Click code which is just YN=1 but then I need to return to the main code to make a decision depending on what button was pressed. It's not like the main code will wait for the user to make a choice before continuing.
I tried to create a loop that continues until YN is equal to anything other than zero but while in the loop it is not checking on the buttons on the form, which Makes me wonder how arcade games work as they are looping to provide animation.
|
|
|
|
|
@Brian_TheLion Hi Brian, I still don't know if the question is displayed in its own Form, rather than on a "Main Form." That's important to know in order to assist you. cheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
I'm using one form only Bill.
Brian
|
|
|
|
|
Here's how I would approach this:
flow-of-control: a GroupBox is shown with a current question; the user must click one of two radio-buttons to enable a Button that moves to the next question. Next questions are presented until the list of questions is enumerated.
0 a Button that will start the quiz 'btnShowQuiz: visible on the Main Form
1 a GroupBox 'grpbxQuiz: set not visible containing:
a TextBox 'tbxQuizQuestion
two RadioButtons 'rbtnYes 'rbtnNo : the 'CheckChanged for both these RadioButtons is set to 'rbtn_CheckedChanged
a Button 'btnNextQuestion
private bool ignoreRBCheckEvent = true;
private List<string> questions = new List<string>
{
"who", "when", "where", "how"
};
private Dictionary<int, bool> QA = new Dictionary<int, bool>();
private int qcnt = 0;
private void btnShowQuiz_Click(object sender, EventArgs e)
{
QA.Clear();
qcnt = 0;
tbxQuizQuestion.Text = questions[0];
btnNextQuestion.Enabled = false;
rbtnYes.Enabled = true;
rbtnYes.CheckedChanged += rbtn_CheckedChanged;
rbtnNo.Enabled = true;
rbtnNo.CheckedChanged += rbtn_CheckedChanged;
ignoreRBCheckEvent = false;
grpbxQuiz.Visible = true;
Cursor.Clip = grpbxQuiz.RectangleToScreen(grpbxQuiz.ClientRectangle);
}
private void BtnNextQuestion_Click(object sender, EventArgs e)
{
ignoreRBCheckEvent = true;
rbtnYes.Checked = false;
rbtnNo.Checked = false;
btnNextQuestion.Enabled = false;
tbxQuizQuestion.Text = questions[qcnt];
ignoreRBCheckEvent = false;
}
private void rbtn_CheckedChanged(object sender, EventArgs e)
{
if (ignoreRBCheckEvent) return;
QA.Add(qcnt++, rbtnYes.Checked);
if (qcnt < questions.Count)
{
btnNextQuestion.Enabled = true;
}
else
{
Cursor.Clip = Rectangle.Empty;
grpbxQuiz.Visible = false;
OnQuizFinished();
}
}
public void OnQuizFinished()
{
foreach (var kvp in QA)
{
Console.WriteLine($"({kvp.Key}) \"{questions[kvp.Key]}\" | {kvp.Value}");
}
} note the use of clipping the Cursor to restrict mouse input to the GroupBox.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 17-Sep-19 5:10am.
|
|
|
|