Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
Read the question carefully
Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
Using Visual Studio 2022 latest build. EDIT: This is not a .NET Framework project, it's a .NET core Windows Forms project, or whatever it's called.
I have a situation where I've added a bunch of controls to a form, but Visual Studio is not updating the Designer.cs file with the new controls. The controls all exist as I placed them on design canvas, but when I compile the project, the controls don't appear in the EXE because the Designer.cs file is not synchronized with the canvas.
Question: How can I force Visual Studio to rewrite the Designer.cs file so that all the controls that I added are accounted for? I'd rather not remove the form from the project and add it back because I'd lose all the work I did to place the controls.
Any assistance is greatly appreciated!
I was able to fix it by removing the project from the solution and then adding it back.
The difficult we do right away...
...the impossible takes slightly longer.
1. Put the serial port code in a handler class that implements IDisposable and pass it to form2 in the constructor:
Using serialHandler AsNew SerialHandler
Dim form2 As Form2 = New Form2(serialHandler)
The Dispose method on the SerialHandler will handle the closing of the serial port if not already closed and dispose of any object that may cause memory leaks.
The other benefit is that you have encapsulated serial port handling and simplified Form2's code.
Note: If not modal, then store a reference to SerialHandler in Form1 and manually call the Dispose method of the SerialHandler class when Form2 is closed - this will require listening for Form2 closing event.
2. Implement IDisposable in Form2 so that when the form is closed and disposed of, the same applies as the first case.
If it was me, I would use Option 1.
"I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee
I have a viewer that displays image files in wimforms. I run it from another external software and pass it file data for display in parameters to main args.
Every time when I call the viewer I want to open the same process in order to immediately open the viewer and not close and restart.
I successful to identify the current running process and also enlarge the same Form window,
but I don't know how to perform show new Form again, So that the viewer will update the view with new files.
I mean , i have current class Process . but i need to execute Application.Run(new Form) but for current process
You don't need to run Application.Run again. What you do need to do is setup some kind of communication channel where the first instance of your app is listening for messages from a second instance. You can launch a second instance of your display app and when it detects that the first instance is already running, send a message over the channel so the first instance can be told what to do, like load a different file and display it.
If DataGridView1.Rows.Count - 1 Then
DataGridView1.CurrentCell = DataGridView1.Rows(DataGridView1.Rows.Count - 1).Cells(1)
i many code try
If (DataGridView1.Rows.Count > 0) Then
For i = 0 To DataGridView1.Rows.Count - 1
If DataGridView1.Rows(i).Cells("d1alisname").Value = "" Then
Thanks to VB's "evil type coercion", that condition will be False if you have precisely one row in your grid. For any other number of rows, that condition will be True.
Sufvan Adil 2023 wrote:
For i = 0To DataGridView1.Rows.Count - 1If DataGridView1.Rows(i).Cells("d1alisname").Value = ""ThenExitSubElse
That code walks through all the rows in your grid until it finds one where the d1alisname column is blank. For every row that it encounters where that column is not blank, it adds a new row.
You haven't explained exactly what you're trying to do. At a guess, you want to add a new row if there are either no rows in the grid, or all of the rows have a value in the d1alisname column. In which case, you need to move the "add row" code after your For loop from your second code block:
For i = 0To DataGridView1.Rows.Count - 1If DataGridView1.Rows(i).Cells("d1alisname").Value = ""ThenExitSubEndIfNext
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
The following problem: Chart x-axis represents calendar weeks from 2021/35 to 2022/36 (current week 2022/19). I don't want to represent every week as a label, but only every 5th week. Up to the current week it looks relatively good, but after that every week is displayed as label.
You should be able to specify which column to use for Labels. Add an extra "label" column to your data and blank out the first 4 in every 5.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
Hello friends. How are you? First of all, I want to say that, I am new to this forum, and this is my first post also. I don't know this is the right place or not. But I expected that I can get better suggestions from you. Guys, I have a problem; That is, I can not solve my Windows10 stuck on loading issue. After several attempts, I had been tried my best effort but the issue is unchanged. Since I am not experienced in this matter; So I am asking you for suggestions in this regard. Can you help me somehow?
Thanks for replying. Whenever I was trying to start Windows10, at this time it stuck while loading. Sorry for unable to upload any screenshot for prof. But I already figure out the issue after finding this on Google. The issue if fixed after resetting the RAM and BIOS. Now it is working normally like earlier.