|
When posting your question please:- 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.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
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.
newchart(chart1)
Dim chartArea1 As New ChartArea("Default")
chart1.AntiAliasing = AntiAliasingStyles.None
chart1.TextAntiAliasingQuality = TextAntiAliasingQuality.Normal
chart1.ChartAreas.Add(chartArea1)
chart1.ChartAreas("Default").CursorX.IsUserEnabled = False
chart1.ChartAreas("Default").CursorX.IsUserSelectionEnabled = False
chart1.ChartAreas("Default").BackGradientStyle = GradientStyle.None
chart1.ChartAreas("Default").Position.Auto = False
chart1.ChartAreas("Default").Position.X = 0
chart1.ChartAreas("Default").Position.Y = 10
chart1.ChartAreas("Default").Position.Width = ChartAreasWidth
chart1.ChartAreas("Default").Position.Height = ChartAreasHeight - 4
chart1.ChartAreas("Default").AxisX.ScaleView.Zoomable = True
chart1.ChartAreas("Default").AxisX.ScrollBar.IsPositionedInside = True
chart1.ChartAreas("Default").AxisX.MajorGrid.Enabled = False
chart1.ChartAreas("Default").AxisX.MajorGrid.LineWidth = 1
chart1.ChartAreas("Default").AxisX.IntervalType = DateTimeIntervalType.Weeks
chart1.ChartAreas("Default").AxisX.Interval = 1
chart1.ChartAreas("Default").AxisX.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont
chart1.ChartAreas("Default").AxisX.LabelAutoFitMinFontSize = 7
chart1.ChartAreas("Default").AxisX.LabelStyle.Font = My.Settings.fontbold8
chart1.ChartAreas("Default").AxisX.LabelStyle.Angle = 90
chart1.ChartAreas("Default").AxisX.MajorTickMark.Enabled = True
chart1.ChartAreas("Default").AxisX.MinorTickMark.Enabled = False
chart1.ChartAreas("Default").AxisX.Minimum = von_X.ToOADate()
chart1.ChartAreas("Default").AxisX.Maximum = bis_X.ToOADate()
chart1.ChartAreas("Default").AxisX.IsMarginVisible = False
chart1.ChartAreas("Default").AxisY.MinorTickMark.Enabled = True
chart1.ChartAreas("Default").AxisY.MinorTickMark.TickMarkStyle = TickMarkStyle.InsideArea
chart1.ChartAreas("Default").AxisY.MajorGrid.LineWidth = 1
chart1.ChartAreas("Default").AxisY.MajorGrid.LineColor = Color.Black
chart1.ChartAreas("Default").AxisY.LabelStyle.Font = My.Settings.fontbold8
chart1.ChartAreas("Default").AxisY.LabelStyle.Format = "C0"
chart1.ChartAreas("Default").AxisY.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont
chart1.ChartAreas("Default").AxisY.LabelAutoFitMinFontSize = 7
chart1.ChartAreas("Default").AxisY.Minimum = 0
chart1.ChartAreas("Default").AxisY2.LineDashStyle = ChartDashStyle.Solid
chart1.ChartAreas("Default").AxisY2.LineWidth = 1
chart1.ChartAreas("Default").AxisY2.LineColor = Color.Black
chart1.ChartAreas("Default").AxisY2.Enabled = AxisEnabled.True
chart1.ChartAreas("Default").AxisY2.MajorTickMark.Enabled = False
chart1.ChartAreas("Default").AxisY2.LabelStyle.ForeColor = Color.Transparent
chart1.ChartAreas("Default").AxisY2.LabelStyle.Font = My.Settings.fontbold8
chart1.ChartAreas("Default").AxisY2.MajorGrid.Enabled = False
chart1.ChartAreas("Default").AxisY2.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont
chart1.ChartAreas("Default").AxisY2.LabelAutoFitMinFontSize = 7
chart1.ChartAreas("Default").BackColor = Color.White
|
|
|
|
|
|
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?
|
|
|
|
|
What is stuck on loading? You have not provided enough information about your problem
|
|
|
|
|
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.
|
|
|
|
|
OK, for future reference, this site is about writing code.
You posted your question in a forum dedicated to writing Windows Forms apps.
|
|
|
|
|
|
|
|
|
|
|
|
|
My WinForms project has a DataGridView component which among other things shows PASS/FAIL text data.
I would like to replace any "PASS" with a check-mark image and any "FAIL" with a cross image but I'm not sure how to achieve this. Any assistance would be appreciated.
|
|
|
|
|
|
Thanks. It is working now. I first created an image column.
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
iconColumn.HeaderText = "Pass/Fail";
iconColumn.Width = 60;
iconColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
iconColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
iconColumn.SortMode = DataGridViewColumnSortMode.NotSortable;
CalGrid.Columns.Insert(2, iconColumn);
I then used the CellFormatting event to set the correct image.
private void CalGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (CalGrid[3,e.RowIndex].Value.ToString() == "PASS")
{
e.Value = imageList1.Images[0];
}
else
{
e.Value = imageList1.Images[1];
}
}
|
|
|
|
|
Use a symbol font with a larger FontSize; e.g. Wingdings.
If it's Windows 10, the MS font Segoe MDL2 Assets has the windows icons and Segoe UI Symbol are the "pre" MDL2 icons. And there's Segoe UI Emoji ✅✔☠ for color.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I am currently writing a WinForms application in C# with a Microsoft Access database backend and using Crystal Reports for reporting.
One table in the database contains a numeric field which can allow any numeric value including zero, but is can also be Null. Currently when I display a report any field that contains a zero value is displayed as empty. I have played around with the "Show zero as" setting but it is either blank for both zero and Null values or it shows "0" for both zero and Null values.
I would like to display "0" for zero values and "" for Null values.
Any Crystal Reports gurus out there?
|
|
|
|
|
Been a while since I have used crystal reports, you will need to use a formula field. In your formula, it is also important to test IsNull first.
Crystal Syntext below,
If IsNull({Table.Field})
" "
Else
{Table.Field}
Hope this helps,
Regards,
Tarco
|
|
|
|
|
I tried this however the syntax has to be:
If IsNull({Table.Field})
" "
Else
totext({Table.Field})
Even when I do this it displays "0". For some reason CR is converting all null values to zeros.
|
|
|
|
|
If you don't mind me asking, how are you connecting to the access database?
|
|
|
|
|
I'm using c# code to connect to the database as follows:
string sql = null;
OleDbConnection cnn = new OleDbConnection(Global.connectionStringAccess);
cnn.Open();
sql = "SELECT * FROM Register WHERE ItemNo = '" + Global.CurrentItem + "'";
OleDbDataAdapter dscmd = new OleDbDataAdapter(sql, cnn);
DataSet ds = new DataSet();
dscmd.Fill(ds, "Register");
cnn.Close();
string rptName = rptPath + "\\rptWorksheet.rpt";
cryRpt.Load(rptName);
cryRpt.SetDataSource(ds.Tables["Register"]);
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
|
|
|
|
|