|
I'm sorry, I don't understand your suggestion...
|
|
|
|
|
Unzip the docx file and take a look at the xml files inside.
|
|
|
|
|
Thanks ... They should have called it .docxzip then.
Or .odoc.
Or anything except .docx.
I know what a .jar file is ... I guess they could have called it .javax, but didn't.
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 got a new laptop with very high resolution. I increased the size text, apps and other to 150%
i work on WinForm program using Visual-Studio 2019.
All the forms in my program are cut and everything goes wrong on the screen.
i try this:
app.manifest
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedos id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}">
app.config
<system.windows.forms.applicationconfigurationsection>
<add key="DpiAwareness" value="PerMonitorV2">
<add key="EnableWindowsFormsHighDpiAutoResizing" value="false">
i work on .NET Framework 4.7.2
i also try this:
https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8
and also this on the main of every form: (Each time something different)
this.AutoScaleMode = AutoScaleMode.Font;
this.AutoScaleMode = AutoScaleMode.Dpi;
this.AutoScaleMode = AutoScaleMode.None;
I have already tried everything .... and nothing helps. any idea ?
thanks
|
|
|
|
|
If the size of the "controls" (on the forms) was fixed, "auto sizing" only the form makes no difference; everything has to be able to resize itself based on its container.
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
|
|
|
|
|
Thanks for the answer, so if I understood correctly, I need all the controls to be AutoSize = true ?
|
|
|
|
|
You prototype to see what works and what doesn't ... for "your" app. I'm not going to tell you to change "everything" to autosize. Sometimes you want something fixed size so you don't get a lot of empty space.
IMO, the "secret" to Windows Forms "fluid" design is to make "everything" "dockable"; that's the basis for fluid design in XAML (wpf and uwp).
Most Windows Forms (designers) use absolute positioning by default.
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
modified 18-Sep-20 17:47pm.
|
|
|
|
|
Yep, Win10 is a pile of crap. If I size everything to 100%, it's so miniscule that it's totally unreadable (for me, in my more mature years). So I set magnification to 125%; most text is now readable, but some older apps remain unaffected. In MS Office most texts are fine, but the icons are absolutely tiny; fortunately I can generally remember the sequence, but otherwise I couldn't use Office apps. Most pop-up boxes from Windows are OK, but some - core Windows pop-ups - are the right size but their controls are misplaced, sometimes outside the boundary of the form. When this happens with an OK or CANCEL button the popup becomes unusable and I have to change the default Windows setting temporarily. Then there's a whole raft of applications - both Microsoft and 3rd party - where the text is displayed fuzzy and makes my eyes hurt to read it.
All this, and it seems that 125% is the default for Win10 on my screen size / resolution. Windows 3.1 was better than this!
|
|
|
|
|
I had similar problems until I set AutoScaleMode to Font. However, I have my 4k laptop screen set to 1920x1080 as well as 150% scaling ... I have vision problems.
«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 also have a laptop with 4K screen (3840X2160) 220% scaling and I also changed AutoScaleMode to Font. and still cut the screens in the my program
|
|
|
|
|
I think you can focus this discussion more by adding to your original post specific details: for example, you create a new WinForm project, size the main form to 800x600, set the StartPosition to 'CenterScreen.
Drop Labels in each corner of the Form: then, run the project, and describe what you observe.
You might also put this code in the main form Load event:
Rectangle r1 = Screen.PrimaryScreen.Bounds;
Rectangle r2 = this.Bounds;
Rectangle r3 = this.ClientRectangle;
Rectangle r4 = this.DisplayRectangle;
Console.WriteLine($"screen {r1}\nform bounds {r2}\nform displayrect {r3}\nform clientrect {r2}"); And, try varying the AutoScaleMode ... the goal being to identify the visually unexpected more clearly.
Hope it helps !
«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
|
|
|
|
|
Well according to the .net Referencesource its:
public const double NaN = (double)0.0 / (double)0.0;
But how? and Why? and foremost how?
0 / 0 should be compiler like " "
what is this compiler trickery?
|
|
|
|
|
|
Can you explain to me why this does not compile.
public class IBase<T> where T:IBase<T>{
public void Foo(T arg){
}
void Bar(){
Foo(this);
}
}
public class Deriv:IBase<Deriv>{
void Bar2(){
this.Foo(this);
}
}
|
|
|
|
|
It'#s complicated: and MS has described it better than I could: Generic Classes - C# Programming Guide | Microsoft Docs[^] - it has a section on inheriting from generic classes.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In IBase<T> , all instance of T are guaranteed to be derived from IBase<T> . But an instance of the current class is not guaranteed to be assignable to T .
Imagine a contrived example:
public class B<T> where T : B<T>
{
public void Foo(T) { }
public void Bar() => Foo(this);
}
public class C : B<C>
{
public void Bar2() => Foo(this);
}
public class D : B<C>
{
public void Bar3() => Foo(this);
public void Bar4() => Bar();
} If the method were allowed in the base class, then class D could simply call that method, and you would pass an instance of class D to a parameter which required an instance of class C . Since there is no conversion from D to C , this would break the runtime.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What a head scratcher. Should be simple to do.
I can't get the & or querystring to append
What I get is https://www.marketplace.com/sh/ord/details?srn=216
I tried & amp; I think %27, Built a Uri using UriBuilder.
First time I've run across this.
var url = "https://www.marketplace.com/sh/ord/details?srn=216&orderid=" + _ebayOrder.OrderNumber;
var psi = new ProcessStartInfo()
{
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
CreateNoWindow = true,
Arguments= "/c start " + url
};
Process.Start(psi);
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
You're overthinking this. All you have to do is start the url:
{
string url = "https://www.google.com";
Process proc = Process.Start(url);
proc.WaitForInputIdle();
}
|
|
|
|
|
cmd /c and cmd /k always treat & as the separator between multiple commands. You are telling it to start the URL up to "srn=216", and then run the command orderid=42 , which won't be recognized.
It won't understand HTML encoding, so using & will simply tell it to start the URL up to "srn=216", and then run the command amp , which also won't be recognized.
If you use the URL-encoded value %26 , the full URL will be executed. But it won't be the URL you need: instead of passing two query-string parameters, srn=216 and orderid=42 , you'll be passing a single parameter - src=216%26orderid=42 . On the server, the src parameter will be equal to "216&orderid=42" .
To escape the URL properly, you would need to prefix the & with ^ , and surround the URL with quotes:
string url = "...?srn=216^&" + _ebayOrder.OrderNumber;
var psi = new ProcessStartInfo()
{
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
CreateNoWindow = true,
Arguments= "/c start \"" + url + "\"",
};
Process.Start(psi); But, as Dave said, you don't need to do that. Just execute the URL directly:
string url = "....?srn=216&" + _ebayOrder.OrderNumber;
Process.Start(url); This will use the ShellExecute function, which will launch the user's default browser and navigate to the URL.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That works!
I didn't mention that this is in my .Net Core Win form app
I ended up with this format because I guess .Net Core didn't like other formats like Dave suggested. It was a .Net Core 3.0 thing or issue. But I would of never figured that out. I knew it had to be escaped, but that character was the farthest thing from my mind.
private void Link_MarketplaceOrder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
var url = "https://www.marketplace.com/sh/ord/details?srn=216^&orderid=" + _marketplaceOrder.OrderNumber;
var psi = new ProcessStartInfo()
{
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
CreateNoWindow = true,
Arguments= "/c start " + url
};
Process.Start(psi);
}
catch (Exception ex)
{
throw ex;
}
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Warning the following warning shows on the first line of all .aspx file in my project.
ASP.NET runtime error: Assembly is still being loaded. (Exception from HRESULT: 0x80131016)
I'm using Visual Studio 2019; WebForms; IIS localhost on my laptop.
Executes ok but the warning is a little disconcerting.
Anyone know what causes this warning?
|
|
|
|
|
Are you loading an assembly manually (such as using the Assembly type)?
If the project loads fine, it might be some internal ASP.NET requirement that is being loaded in the background; I would still investigate to see what modules am I loading in the app domain.
Is this a new project? If so, please consider moving to ASP.NET Core, ASP.NET is a legacy system now.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Thanks for the reply.
No. Not loading manually.
The problem seemed to come from nowhere. Made some changes in the code behind and the warning appeared.
It's an old project and quite large. Conversion seems like a huge task.
|
|
|
|
|
Getting This Error...
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Tweetinvi.Logic
StackTrace:
at Tweetinvi.Logic.JsonConverters.JsonLanguageConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Tweetinvi.Logic.JsonConverters.JsonPropertyConverterRepository.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.Serialization.JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at Tweetinvi.Logic.JsonConverters.JsonInterfaceToObjectConverter`2.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters)
at Tweetinvi.Logic.Wrapper.JsonConvertWrapper.DeserializeObject[T](String json, JsonConverter[] converters)
at Tweetinvi.Logic.JsonConverters.JsonObjectConverter.DeserializeObject[T](String json, JsonConverter[] converters)
at Tweetinvi.Credentials.TwitterAccessor.ExecuteGETQuery[T](String query, JsonConverter[] converters)
at Tweetinvi.Factories.User.UserFactoryQueryExecutor.GetAuthenticatedUser(IGetAuthenticatedUserParameters parameters)
at Tweetinvi.Factories.User.UserFactory.GetAuthenticatedUser(ITwitterCredentials credentials, IGetAuthenticatedUserParameters parameters)
at Tweetinvi.User.GetAuthenticatedUser(ITwitterCredentials credentials, IGetAuthenticatedUserParameters parameters)
at WindowsFormsApp1.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\kaushal dave\source\repos\ConsoleApp2\WindowsFormsApp1\Form1.cs:line 27
This exception was originally thrown at this call stack:
[External Code]
WindowsFormsApp1.Form1.Form1_Load(object, System.EventArgs) in Form1.cs
My Code Is...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tweetinvi;
namespace WindowsFormsApp1
{
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
Auth.SetUserCredentials("gMy1b6ibNDXWxxxxxxxxxxxxxxx",
"SegnDBtorp2FzHG2zEaF22Z9zxxxxxxxxxxxxxxxxxxxxxxxx",
"8808475446533160xxxxxxxxxxxxxxxxxxxxxxxxxx",
"RgFrgQJOMnJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
}
private void Form1_Load(object sender, EventArgs e)
{
var user = User.GetAuthenticatedUser();
pbProfileImage.ImageLocation = user.ProfileBackgroundImageUrl;
lblProfileName.Text = user.Name;
lblProfileHendler.Text = user.ScreenName;
}
}
}
modified 15-Sep-20 2:17am.
|
|
|
|
|
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterdays shirt when you took it off last night.
We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!
Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.
But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
At a guess, your authentication is failing - but we can't test that!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|