Microsoft Q&A

.NET

20,559 questions

Microsoft Technologies based on the .NET software framework.

Browse all .NET tags

20,559 questions with .NET-related tags

Sort by: Updated
1 answer One of the answers was accepted by the question author.

How to display ContextMenu on certain TreeViewItem and highlight the selected TreeViewItem in WPF following MVVM

Following MVVM, I have developed a TreeView and now I want mouse right click to show ContextMenu on certain TreeViewItem. As you can see in the screeshot, I only want the ContextMenu to be displayed when mouse right clicks on the first level…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,474 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
687 questions
asked 2023-09-20T10:36:51.4633333+00:00
BabyHai 41 Reputation points
edited a comment 2023-09-22T10:51:17.3833333+00:00
BabyHai 41 Reputation points
0 answers

handling enter press on a form

Hi , Can someone pls suggest how to detect if the user presses enter key on his keyboard so that we can capture that event . i don't have and don't want a button(or a hidden button) for that purpose (as the size of the form is too small) .

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-22T10:46:45.1433333+00:00
Shaifali jain 80 Reputation points
2 answers One of the answers was accepted by the question author.

minimum rows to display in datagridview

hello , is there a way by which i can set that there must be minimum number of rows is available to display in datagridview regardless of the data it has or not .

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-20T15:09:51.38+00:00
Shaifali jain 80 Reputation points
accepted 2023-09-22T10:36:39.5833333+00:00
Shaifali jain 80 Reputation points
2 answers

Special characters in a textbox

Hi , i have crated a textbox which shows current date . i want that user cannot enter special characters inside that except - or / . can you please suggest how to do it .

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-22T09:07:13.48+00:00
Shaifali jain 80 Reputation points
commented 2023-09-22T10:35:54.8166667+00:00
Shaifali jain 80 Reputation points
1 answer

WPF custom animation thread

Hello, I have a small simple WPF application (I am learing by doing). I made some custom drawing on a Canvas declared in XAML, by using code in the corresponding C# file. Now I want to access the canvas from another thread to be able to apply geometric…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
2,017 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,474 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
5,938 questions
asked 2023-09-16T17:21:29.6333333+00:00
Daniel Santos 0 Reputation points
commented 2023-09-22T09:56:41.3666667+00:00
Hui Liu-MSFT 21,376 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Gap between Text and underline of label control

Hi , is it possible to increase the gap between the text and underline in a label control . for example , below is a label with underline in vs and this is what i have to

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-22T08:49:58.82+00:00
Shaifali jain 80 Reputation points
accepted 2023-09-22T09:55:59.7833333+00:00
Shaifali jain 80 Reputation points
3 answers One of the answers was accepted by the question author.

How to fix double permission popup in xamarin ios web view

When I am trying to use camera in a web view, there are two permissions that are asked in iOS. One is the popup created from browser and the other is created from the Phone. Are there are any ways to avoid the browser popup for camera permission? …

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,145 questions
asked 2023-02-06T09:19:10.4933333+00:00
Anila Mathew 25 Reputation points
edited an answer 2023-09-22T09:55:28.97+00:00
Learnaholic Pte Ltd 0 Reputation points
1 answer

Xamarin.Forms building with Pair to Mac XCode 15, building for iOS 17

VS Version 2022 Pro 17.6.5 Xamarin.Forms 5.0.0.2312 XCode 15 Xamarin.iOS 16.4.0.18 - Installed Manually Mac M2 Ventura 13.5.2 I am unable to debug my application on my Visual Studio. Another issue that started happening is I am opening and creating…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,145 questions
asked 2023-09-21T07:54:29.7833333+00:00
Deon Van Niekerk 0 Reputation points
answered 2023-09-22T09:48:45.58+00:00
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 22,331 Reputation points Microsoft Vendor
3 answers One of the answers was accepted by the question author.

The type or namespace name 'Notes' could not be found

Hi, How to resolve such issue, to the line below? using Notes.Models;

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,145 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,767 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-16T06:33:54.24+00:00
Peter_1985 2,116 Reputation points
accepted 2023-09-22T09:44:08.83+00:00
Peter_1985 2,116 Reputation points
1 answer

Use Azure Function (.Net 6) with JwtBearer middleware

Hello, I couldn't find any official documentation on the following: I want Azure function to use bearer token authentication. Is it possible to use Azure Function (.Net 6) with JwtBearer middleware? So like in an ASP.NET app, set this code into…

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,430 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
2,017 questions
asked 2023-09-19T15:32:07.0833333+00:00
Anita A 25 Reputation points
commented 2023-09-22T09:35:40.5066667+00:00
Anita A 25 Reputation points
1 answer

Running Xamarin iOS Error simctl returned exit code 4

Hi Three days ago, my app ran well and deployed smoothly to Emulator on my mac until today when I tried to run again, my apps cannot run with the error Error on Visual Studio Severity Code Description Project File Line Suppression State Error error…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,145 questions
asked 2023-09-21T12:32:39.5166667+00:00
Yohanes AI 0 Reputation points
answered 2023-09-22T09:29:42.7633333+00:00
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 22,331 Reputation points Microsoft Vendor
1 answer

.NET Maui support - Splash image size

I'm using .NET Maui and would like to add the splash screen. Now Maui uses a single svg file. Checking the Android documentation, there's a new size for the splash https://developer.android.com/develop/ui/views/launch/splash-screen for Android v12 and…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,767 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1,834 questions
asked 2023-06-12T15:09:51.0333333+00:00
Junior Saravia 20 Reputation points
commented 2023-09-22T09:28:09.15+00:00
Jockey Zheng 0 Reputation points
0 answers

Return values from a form

Hi , Which is the best technique to return values from a form and use that in another form . like using a variable or some other way . for example , i have a form with a textbox which returns a value . i want to use that value in the textbox of other…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-22T09:26:05.5166667+00:00
Shaifali jain 80 Reputation points
0 answers

How to run AI model in a Blazor frontend

Hi, What is the best way to run a AI model (programmed in Python) that has been deployed in Azure as a managed endpoint in the Blazor frontend of each user of a Blazor website? Is there a way to run the AI model in the Blazor frontend in a simple and…

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,075 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,917 questions
Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
93 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,102 questions
.NET Machine learning
.NET Machine learning
.NET: Microsoft Technologies based on the .NET software framework.Machine learning: A type of artificial intelligence focused on enabling computers to use observed data to evolve new behaviors that have not been explicitly programmed.
131 questions
asked 2023-09-21T17:27:39.8233333+00:00
Héðinn Steingrímsson 0 Reputation points
edited a comment 2023-09-22T09:18:00.3233333+00:00
santoshkc 0 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Event for changing backcolor of form

Hi , suppose if i want to change the backcolor of a windows form by hard coding which is the best event to do it . like load or paint or shown or something else .

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-09-22T08:54:10.14+00:00
Shaifali jain 80 Reputation points
accepted 2023-09-22T09:15:49.3133333+00:00
Shaifali jain 80 Reputation points
1 answer

How to validate XML dataset when hexadecimal invalid character arrives

I am processing some xml document. while reading xml value through dataset, I am getting below error. System.Xml.XmlException: ''', hexadecimal value 0x02, is an invalid character. Line 1, position 989.' How to avoid this...? How to validate and…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
2,017 questions
asked 2023-09-21T09:49:42.04+00:00
Gani_tpt 1,401 Reputation points
commented 2023-09-22T09:05:58.8666667+00:00
Jiale Xue - MSFT 10,156 Reputation points Microsoft Vendor
1 answer

Setting XML Root XMLNS

Hi, Everybody! I need to create a Shipment XML root whose xmlns is the following fictitious XSD URL: http://api.company.com/schemas/api/company-api-vN.xsd. <?xml version="1.0"…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
2,017 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
1,041 questions
asked 2023-09-19T12:11:16.19+00:00
Julio Bello 201 Reputation points
edited an answer 2023-09-22T09:03:26.7266667+00:00
Hui Liu-MSFT 21,376 Reputation points Microsoft Vendor
2 answers

Windows Forms Designer error : Value cannot be null. Parameter name: instance

I am developing an app using C# Windows Forms with framework DevExpress. My IDE are Visual Studio Community 2022. It is all okay. But after I am updating to Version 17.6.0 the window that I develop cannot load design mode with error message…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,625 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,767 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,949 questions
asked 2023-05-18T02:41:37.96+00:00
Ahmad Ganteng 0 Reputation points
commented 2023-09-22T08:54:30.6433333+00:00
Ahmad Ganteng 0 Reputation points
3 answers One of the answers was accepted by the question author.

Problem converting SQL to Entitiy Framework

Problem: I have a batch job, that does intense writing to the db. I have got the task, to re-write it in Entity framework. The SQL code below, does only require óne call to the database. The sql below has been simplified with only 3 insert. But in my…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
583 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
2,017 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
10,913 questions
asked 2023-09-19T10:27:34.34+00:00
LearningDotnetMartin 0 Reputation points
accepted 2023-09-22T08:49:23.0366667+00:00
LearningDotnetMartin 0 Reputation points
0 answers

visual studio 2022 error mt1007 failed to launch application

I recently upgraded windows visual studio to 17.5.4 Windows Xamarin Forms to 5.0.0.2545 When I try to debug the Xamarin iOS application I get the following: error MT1007: Failed to launch the application…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,145 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
835 questions
asked 2023-04-18T19:51:51.3333333+00:00
Seth Isaacks 46 Reputation points
commented 2023-09-22T08:36:22.14+00:00
Kim Strasser 621 Reputation points